@NotNull @Override public NodeState merge(@NotNull NodeBuilder builder, @NotNull CommitHook commitHook, @NotNull CommitInfo info) throws CommitFailedException { return getNodeStore(builder).merge(builder, commitHook, info); }
private static void merge(NodeStore store, NodeBuilder builder) throws CommitFailedException { store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); } }
private static void merge(NodeStore ns, NodeBuilder builder) throws CommitFailedException { ns.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); } }
private static void merge(NodeStore store, NodeBuilder builder) throws CommitFailedException { store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); } }
private void merge(NodeStore store, NodeBuilder builder) throws CommitFailedException { store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); } }
private static void merge(NodeStore store, NodeBuilder builder) throws CommitFailedException { store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); } }
private static NodeState merge(NodeStore store, NodeBuilder root) throws CommitFailedException { return store.merge(root, EmptyHook.INSTANCE, CommitInfo.EMPTY); } }
private void merge(NodeBuilder builder) throws CommitFailedException { //TODO Configure validator CompositeHook hooks = createCommitHook(); nodeStore.merge(builder, hooks, createCommitInfo()); }
private NodeState copyDiffToTarget(NodeState before, NodeState after, NodeState targetRoot) throws CommitFailedException { NodeBuilder targetBuilder = targetRoot.builder(); NodeState currentRoot = wrapNodeState(after, true); NodeState baseRoot = wrapNodeState(before, false); currentRoot.compareAgainstBaseState(baseRoot, new ApplyDiff(targetBuilder)); return targetNodeStore.merge(targetBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
private static NodeStore init(NodeStore store) throws CommitFailedException { NodeBuilder builder = store.getRoot().builder(); builder.setChildNode("root"); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); return store; }
protected byte[] addTestContent(NodeStore store, String child, int size) throws CommitFailedException, IOException { NodeBuilder builder = store.getRoot().builder(); builder.child(child).setProperty("ts", System.currentTimeMillis()); byte[] data = new byte[size]; new Random().nextBytes(data); Blob blob = store.createBlob(new ByteArrayInputStream(data)); builder.child(child).setProperty("testBlob", blob); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); return data; }
public static void addTestContent(NodeStore store, String child) throws CommitFailedException { NodeBuilder builder = store.getRoot().builder(); builder.child(child).setProperty("ts", System.currentTimeMillis()); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
private static void testContent(NodeStore store, int numOfNodes) throws Exception { NodeBuilder builder = store.getRoot().builder(); for (int i = 0; i < numOfNodes; i++) { builder.child("testRoot"+i).setProperty("foo", "abc " + System.currentTimeMillis()); } store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
/** * test method to change the clusterId explicitly * * @throws CommitFailedException **/ private static void setId(NodeStore store, String clusterId) throws CommitFailedException { NodeState root = store.getRoot(); NodeBuilder builder = root.builder(); builder.child(ClusterRepositoryInfo.CLUSTER_CONFIG_NODE) .setProperty(ClusterRepositoryInfo.CLUSTER_ID_PROP, clusterId); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
private NodeState createNode(NodeStore ns, String path) throws CommitFailedException { NodeBuilder nb = ns.getRoot().builder(); NodeBuilder cb = nb; for (String name : PathUtils.elements(path)) { cb = cb.child(name); } return ns.merge(nb, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
private void prepareStore() throws CommitFailedException { activateMBean(); NodeState root = store.getRoot(); NodeBuilder builder = root.builder(); new InitialContent().initialize(builder); store.merge(builder, HOOK, CommitInfo.EMPTY); }
@Before public void setUp() throws CommitFailedException { NodeBuilder builder = store.getRoot().builder(); new InitialContent().initialize(builder); store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
private static void modifyTestContent(NodeStore nodeStore) throws CommitFailedException { NodeBuilder builder = nodeStore.getRoot().builder(); builder.getChildNode("a").getChildNode("aa").remove(); builder.getChildNode("b").setProperty("bin", "changed"); builder.getChildNode("c").removeProperty("bins"); nodeStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
private static void addTestContent(NodeStore nodeStore) throws CommitFailedException, IOException { NodeBuilder builder = nodeStore.getRoot().builder(); builder.setChildNode("a").setChildNode("aa").setProperty("p", 42); builder.getChildNode("a").setChildNode("error").setChildNode("IOException"); builder.setChildNode("b").setProperty("bin", createBlob(nodeStore, 42)); builder.setChildNode("c").setProperty(binaryPropertyFromBlob("bins", createBlobs(nodeStore, 42, 43, 44))); nodeStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }
@Before public void setup() throws CommitFailedException, IOException { store = SegmentNodeStoreBuilders.builder(new MemoryStore()).build(); NodeBuilder rootBuilder = this.store.getRoot().builder(); NodeBuilder countries = rootBuilder.child("countries"); countries.child("uk").child("cities").child("london").child("districts").child("frognal"); countries.child("germany"); countries.child("france").child("cities").child("paris"); store.merge(rootBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY); }