org.apache.jackrabbit.oak.spi.state.NodeStore.checkpoint()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.apache.jackrabbit.oak.spi.state.NodeStore.checkpoint()方法的一些代码示例,展示了NodeStore.checkpoint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NodeStore.checkpoint()方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.spi.state.NodeStore
类名称:NodeStore
方法名:checkpoint

NodeStore.checkpoint介绍

[英]Creates a new checkpoint of the latest root of the tree. The checkpoint remains valid for at least as long as requested and allows that state of the repository to be retrieved using the returned opaque string reference.

This method is a shortcut for #checkpoint(long,Map) passing an empty map for its 2nd argument.
[中]创建树的最新根的新检查点。检查点至少在请求的时间内保持有效,并允许使用返回的不透明字符串引用检索存储库的状态。
此方法是#checkpoint(long,Map)为其第二个参数传递空映射的快捷方式。

代码示例

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
@Override
public String checkpoint(long lifetime, @NotNull Map<String, String> properties) {
  return getNodeStore().checkpoint(lifetime, properties);
}

代码示例来源:origin: org.apache.jackrabbit/oak-core

public BranchNodeStore(NodeStore nodeStore) throws CommitFailedException {
  this.nodeStore = nodeStore;
  this.inheritedCheckpoints = newArrayList(nodeStore.checkpoints());
  this.checkpointMapping = newConcurrentMap();
  String cp = nodeStore.checkpoint(CHECKPOINT_LIFETIME, singletonMap("type", "copy-on-write"));
  memoryNodeStore = new MemoryNodeStore(nodeStore.retrieve(cp));
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void checkpointInfo() throws CommitFailedException {
  ImmutableMap<String, String> props = ImmutableMap.of(
      "one", "1", "two", "2", "three", "2");
  String cp = store.checkpoint(Long.MAX_VALUE, props);
  assertEquals(props, store.checkpointInfo(cp));
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Nonnull
@Override
public String checkpoint(long lifetime) {
  return getNodeStore().checkpoint(lifetime);
}

代码示例来源:origin: apache/jackrabbit-oak

public BranchNodeStore(NodeStore nodeStore) throws CommitFailedException {
  this.nodeStore = nodeStore;
  this.inheritedCheckpoints = newArrayList(nodeStore.checkpoints());
  this.checkpointMapping = newConcurrentMap();
  String cp = nodeStore.checkpoint(CHECKPOINT_LIFETIME, singletonMap("type", "copy-on-write"));
  memoryNodeStore = new MemoryNodeStore(nodeStore.retrieve(cp));
}

代码示例来源:origin: org.apache.jackrabbit/oak-core

@NotNull
@Override
public String checkpoint(long lifetime) {
  return getNodeStore().checkpoint(lifetime);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

public BranchNodeStore(NodeStore nodeStore) throws CommitFailedException {
  this.nodeStore = nodeStore;
  this.inheritedCheckpoints = newArrayList(nodeStore.checkpoints());
  this.checkpointMapping = newConcurrentMap();
  String cp = nodeStore.checkpoint(CHECKPOINT_LIFETIME, singletonMap("type", "copy-on-write"));
  memoryNodeStore = new MemoryNodeStore(nodeStore.retrieve(cp));
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Nonnull
@Override
public String checkpoint(long lifetime, @Nonnull Map<String, String> properties) {
  return getNodeStore().checkpoint(lifetime, properties);
}

代码示例来源:origin: org.apache.jackrabbit/oak-core

@NotNull
@Override
public String checkpoint(long lifetime, @NotNull Map<String, String> properties) {
  return getNodeStore().checkpoint(lifetime, properties);
}

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
@Override
public String checkpoint(long lifetime) {
  return getNodeStore().checkpoint(lifetime);
}

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
@Override
public String checkpoint(long lifetime, @NotNull Map<String, String> properties) {
  return getNodeStore().checkpoint(lifetime, properties);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Nonnull
@Override
public String checkpoint(long lifetime, @Nonnull Map<String, String> properties) {
  return getNodeStore().checkpoint(lifetime, properties);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String checkpoint(long lifetime) {
  return getNodeStore().checkpoint(lifetime);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public String checkpoint(long lifetime) {
  return getNodeStore().checkpoint(lifetime);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String checkpoint(long lifetime, Map<String, String> properties) {
  Map<String, String> globalProperties = newHashMap(properties);
  globalProperties.put(CHECKPOINT_METADATA + "created", Long.toString(currentTimeMillis()));
  globalProperties.put(CHECKPOINT_METADATA + "expires", Long.toString(currentTimeMillis() + lifetime));
  String newCheckpoint = ctx.getGlobalStore().getNodeStore().checkpoint(lifetime, globalProperties);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Created checkpoint {}. Debug info:\n{}", newCheckpoint, checkpointDebugInfo());
  }
  return newCheckpoint;
}

代码示例来源:origin: apache/jackrabbit-oak

public Void acquire() {
  checkpoint = nodeStore.checkpoint(DAYS.toMillis(1));
  return null;
}

代码示例来源:origin: apache/jackrabbit-oak

@Override public String createCheckpoint(long lifetime) {
  Map<String, String> props = Maps.newHashMap();
  props.put(CREATION_DATE, String.valueOf(clock.getTime()));
  String checkpoint = nodeStore.checkpoint(lifetime, props);
  return checkpoint;
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void noContentChangeForCheckpoints() throws Exception{
  final AtomicInteger invocationCount = new AtomicInteger();
  ((Observable)store).addObserver(new Observer() {
    @Override
    public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) {
      invocationCount.incrementAndGet();
    }
  });
  invocationCount.set(0);
  String cp = store.checkpoint(Long.MAX_VALUE);
  assertEquals(0, invocationCount.get());
  store.release(cp);
  assertEquals(0, invocationCount.get());
}

代码示例来源:origin: apache/jackrabbit-oak

private String createIndexDirs(String... indexPaths) throws IOException, CommitFailedException {
  String checkpoint = store.checkpoint(1000000);
  IndexerInfo info = new IndexerInfo(temporaryFolder.getRoot(), checkpoint);
  info.save();
  for (String indexPath : indexPaths){
    createIndexFolder(temporaryFolder.getRoot(), indexPath);
  }
  dumpIndexDefinitions(indexPaths);
  return checkpoint;
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
public void checkpoint() throws CommitFailedException {
  String cp = store.checkpoint(Long.MAX_VALUE);
  NodeBuilder builder = store.getRoot().builder();
  builder.setChildNode("new");
  store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
  assertFalse(root.equals(store.getRoot()));
  assertEquals(root, store.retrieve(cp));
  assertTrue(store.release(cp));
  assertNull(store.retrieve(cp));
}

相关文章