@Test public void testFetchLinearGraph() { REPOSITORY.setGraph(g -> { g.add(0, 1, add(1)); g.add(1, 2, add(2)); g.add(2, 3, add(3)); g.add(3, 4, add(4)); g.add(4, 5, add(5)); g.add(5, 6, add(6)); }); FetchData<Integer, TestOp> fetchData1 = await(node.fetch(0)); assertFetchData(6, 7, 21, fetchData1); FetchData<Integer, TestOp> fetchData2 = await(node.fetch(3)); assertFetchData(6, 7, 15, fetchData2); }
@Override public Promise<FetchData<K, D>> fetch(K currentCommitId) { return repository.getHeads() .then(heads -> doFetch(heads, currentCommitId)) .whenComplete(toLogger(logger, thisMethod(), currentCommitId)); }
OTUplinkImpl implements OTUplink<K, D, PC> { @Override public Promise<FetchData<K, D>> fetch(K currentCommitId) { return repository.getHeads() .then(heads -> doFetch(heads, currentCommitId)) .whenComplete(toLogger(logger, thisMethod(), currentCommitId)); } }
OTUplinkImpl implements OTUplink<K, D, PC> { @Override public Promise<FetchData<K, D>> fetch(K currentCommitId) { return repository.getHeads() .then(heads -> doFetch(heads, currentCommitId)) .whenComplete(toLogger(logger, thisMethod(), currentCommitId)); } private  OTUplinkImpl(OTRepository<K, D> repository, OTSystem<D> otSystem, Function<OTCommit<K, D>, PC> protoCommitEncoder,
			Function<PC, OTCommit<K, D>> protoCommitDecoder); }
OTUplinkImpl implements OTUplink<K, D, PC> { @Override public Promise<FetchData<K, D>> fetch(K currentCommitId) { return repository.getHeads() .then(heads -> doFetch(heads, currentCommitId)) .whenComplete(toLogger(logger, thisMethod(), currentCommitId)); } private  OTUplinkImpl(OTRepository<K, D> repository, OTSystem<D> otSystem, Function<OTCommit<K, D>, PC> protoCommitEncoder,
			Function<PC, OTCommit<K, D>> protoCommitDecoder); static OTUplinkImpl<K, D, C> create(OTRepository<K, D> repository, OTSystem<D> otSystem,
			Function<OTCommit<K, D>, C> commitToObject, Function<C, OTCommit<K, D>> objectToCommit); static OTUplinkImpl<K, D, OTCommit<K, D>> create(OTRepository<K, D> repository, OTSystem<D> otSystem); OTRepository<K, D> getRepository(); @Override Promise<PC> createProtoCommit(K parent, List<D> diffs, long parentLevel); @Override Promise<FetchData<K, D>> push(PC protoCommit); @Override Promise<FetchData<K, D>> checkout(); @Override Promise<FetchData<K, D>> fetch(K currentCommitId); @Override Promise<FetchData<K, D>> poll(K currentCommitId); }
OTUplinkImpl implements OTUplink<K, D, PC> { @Override public Promise<FetchData<K, D>> fetch(K currentCommitId) { return repository.getHeads() .then(heads -> doFetch(heads, currentCommitId)) .whenComplete(toLogger(logger, thisMethod(), currentCommitId)); } private  OTUplinkImpl(OTRepository<K, D> repository, OTSystem<D> otSystem, Function<OTCommit<K, D>, PC> protoCommitEncoder,
			Function<PC, OTCommit<K, D>> protoCommitDecoder); static OTUplinkImpl<K, D, C> create(OTRepository<K, D> repository, OTSystem<D> otSystem,
			Function<OTCommit<K, D>, C> commitToObject, Function<C, OTCommit<K, D>> objectToCommit); static OTUplinkImpl<K, D, OTCommit<K, D>> create(OTRepository<K, D> repository, OTSystem<D> otSystem); OTRepository<K, D> getRepository(); @Override Promise<PC> createProtoCommit(K parent, List<D> diffs, long parentLevel); @Override Promise<FetchData<K, D>> push(PC protoCommit); @Override Promise<FetchData<K, D>> checkout(); @Override Promise<FetchData<K, D>> fetch(K currentCommitId); @Override Promise<FetchData<K, D>> poll(K currentCommitId);  }