@NotNull @Override public String checkpoint(long lifetime, @NotNull Map<String, String> properties) { return getNodeStore().checkpoint(lifetime, properties); }
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)); }
@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)); }
@Nonnull @Override public String checkpoint(long lifetime) { return getNodeStore().checkpoint(lifetime); }
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)); }
@NotNull @Override public String checkpoint(long lifetime) { return getNodeStore().checkpoint(lifetime); }
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)); }
@Nonnull @Override public String checkpoint(long lifetime, @Nonnull Map<String, String> properties) { return getNodeStore().checkpoint(lifetime, properties); }
@NotNull @Override public String checkpoint(long lifetime, @NotNull Map<String, String> properties) { return getNodeStore().checkpoint(lifetime, properties); }
@NotNull @Override public String checkpoint(long lifetime) { return getNodeStore().checkpoint(lifetime); }
@NotNull @Override public String checkpoint(long lifetime, @NotNull Map<String, String> properties) { return getNodeStore().checkpoint(lifetime, properties); }
@Nonnull @Override public String checkpoint(long lifetime, @Nonnull Map<String, String> properties) { return getNodeStore().checkpoint(lifetime, properties); }
@Override public String checkpoint(long lifetime) { return getNodeStore().checkpoint(lifetime); }
@Override public String checkpoint(long lifetime) { return getNodeStore().checkpoint(lifetime); }
@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; }
public Void acquire() { checkpoint = nodeStore.checkpoint(DAYS.toMillis(1)); return null; }
@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; }
@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()); }
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; }
@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)); }