@Test public void createBuildRequestIdPath() { final PersistentBuildMetadataStore store = new PersistentBuildMetadataStore(mdStorepath); Assert.assertEquals(mdStorepath.resolve("a/b/c/d/efgh"), store.createBuildRequestIdPath("abcdefgh")); }
public Path createBuildRequestIdPath(String hash) { int i = 0; final Path p = rootDirectory.resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)) .resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)).resolve(hash.substring(i++)); assert i == DISTRIBUTION_DEPTH; return p; }
PersistentBuildMetadataStore implements BuildMetadataStore { public Path createBuildRequestIdPath(String hash) { int i = 0; final Path p = rootDirectory.resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)) .resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)).resolve(hash.substring(i++)); assert i == DISTRIBUTION_DEPTH; return p; } }
PersistentBuildMetadataStore implements BuildMetadataStore { public Path createBuildRequestIdPath(String hash) { int i = 0; final Path p = rootDirectory.resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)) .resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)).resolve(hash.substring(i++)); assert i == DISTRIBUTION_DEPTH; return p; } PersistentBuildMetadataStore(Path rootDirectory); }
PersistentBuildMetadataStore implements BuildMetadataStore { public Path createBuildRequestIdPath(String hash) { int i = 0; final Path p = rootDirectory.resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)) .resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)).resolve(hash.substring(i++)); assert i == DISTRIBUTION_DEPTH; return p; } PersistentBuildMetadataStore(Path rootDirectory); Path createBuildRequestIdPath(String hash); @Override CheckSha1Consumer createCheckSha1Checker(String requestId, String buildRequestIdHash); @Override StoreSha1Consumer createStoreSha1Consumer(String requestId, String buildRequestIdHash); @Override String retrieveCommitId(String requestId, String buildRequestIdHash); @Override String retrieveSha1(String requestId, String buildRequestIdHash, Gavtc gavtc); @Override void storeCommitId(String requestId, String buildRequestIdHash, String commitId); @Override void storeSha1(String requestId, String buildRequestIdHash, Gavtc gavtc, String sha1); @Override void walkBuildRequestHashes(Consumer<String> consumer); }
PersistentBuildMetadataStore implements BuildMetadataStore { public Path createBuildRequestIdPath(String hash) { int i = 0; final Path p = rootDirectory.resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)) .resolve(hash.substring(i++, i)).resolve(hash.substring(i++, i)).resolve(hash.substring(i++)); assert i == DISTRIBUTION_DEPTH; return p; } PersistentBuildMetadataStore(Path rootDirectory); Path createBuildRequestIdPath(String hash); @Override CheckSha1Consumer createCheckSha1Checker(String requestId, String buildRequestIdHash); @Override StoreSha1Consumer createStoreSha1Consumer(String requestId, String buildRequestIdHash); @Override String retrieveCommitId(String requestId, String buildRequestIdHash); @Override String retrieveSha1(String requestId, String buildRequestIdHash, Gavtc gavtc); @Override void storeCommitId(String requestId, String buildRequestIdHash, String commitId); @Override void storeSha1(String requestId, String buildRequestIdHash, Gavtc gavtc, String sha1); @Override void walkBuildRequestHashes(Consumer<String> consumer);  }