target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testMarkAsNoFilterExists() throws Exception { List<Path> files = createTempTestFiles(1); Path file = files.get(0); when(imageRepository.getByPath(file)).thenReturn(new ImageRecord(file.toString(), TEST_HASH)); dupOp.markAs(file, TAG_FOO); verify(filterRepository).store(fooFilter); }
public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } }
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } }
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
@Test public void testMarkAsDBerror() throws Exception { List<Path> files = createTempTestFiles(1); Path file = files.get(0); when(imageRepository.getByPath(file)).thenThrow(new RepositoryException("This is a test")); dupOp.markAs(file, TAG_FOO); verify(filterRepository, never()).store(any(FilterRecord.class)); }
public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } }
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } }
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
@Test public void testMarkAsFilterExists() throws Exception { List<Path> files = createTempTestFiles(1); Path file = files.get(0); when(imageRepository.getByPath(file)).thenReturn(new ImageRecord(file.toString(), 42)); dupOp.markAs(file, TAG_FOO); verify(filterRepository).store(new FilterRecord(42, TAG_FOO)); }
public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } }
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } }
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
DuplicateOperations { public void markAs(Result result, Tag tag) { try { markAs(result.getImageRecord(), tag); } catch (RepositoryException e) { logger.warn(FILTER_ADD_FAILED_MESSAGE, result.getImageRecord().getPath(), e.getMessage()); } } @Inject DuplicateOperations(FilterRepository filterRepository, TagRepository ta...
@Test public void testMarkDirectory() throws Exception { createTempTestFiles(3); dupOp.markDirectoryAs(tempDirectory, TAG_FOO); verify(imageRepository, times(3)).getByPath(any(Path.class)); verify(filterRepository, never()).store(any(FilterRecord.class)); }
public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.next(); if (Files.isRegu...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
@Test public void testMarkDirectoryNotAdirectory() throws Exception { List<Path> files = createTempTestFiles(3); Path file = files.get(0); dupOp.markDirectoryAs(file, TAG_FOO); verify(imageRepository, never()).getByPath(any(Path.class)); verify(filterRepository, never()).store(any(FilterRecord.class)); }
public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.next(); if (Files.isRegu...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
@Test public void testMarkDirectoryDirectoryIsNull() throws Exception { createTempTestFiles(3); dupOp.markDirectoryAs(null, TAG_FOO); verify(imageRepository, never()).getByPath(any(Path.class)); verify(filterRepository, never()).store(any(FilterRecord.class)); }
public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.next(); if (Files.isRegu...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
@Test public void testAreAttributesValidHashAndTimestampBefore() throws Exception { ExtendedAttribute.setExtendedAttribute(tempFile, testHashFullName, Long.toString(TEST_VALUE)); long timestamp = Files.getLastModifiedTime(tempFile).toMillis(); timestamp -= TimeUnit.MILLISECONDS.convert(1, TimeUnit.HOURS); ExtendedAttri...
public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; }
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } }
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } HashAttribute(String hashName); }
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } HashAttribute(String hashName); boolean areAttri...
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } HashAttribute(String hashName); boolean areAttri...
@Test public void testMarkDirectoryDirectoryNonExistantDirectory() throws Exception { createTempTestFiles(3); dupOp.markDirectoryAs(tempDirectory.resolve("foobar"), TAG_FOO); verify(imageRepository, never()).getByPath(any(Path.class)); verify(filterRepository, never()).store(any(FilterRecord.class)); }
public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.next(); if (Files.isRegu...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
DuplicateOperations { public void markDirectoryAs(Path directory, Tag tag) { if (!isDirectory(directory)) { logger.warn("Directory {} not valid, aborting.", directory); return; } try { int addCount = 0; Iterator<Path> iter = Files.newDirectoryStream(directory).iterator(); while (iter.hasNext()) { Path current = iter.ne...
@Test public void testMarkAll() throws Exception { LinkedList<Result> records = new LinkedList<>(); records.add(new Result(resultGroup, new ImageRecord(TAG_FOO.getTag(), 0))); records.add(new Result(resultGroup, new ImageRecord(TAG_BAR.getTag(), 1))); dupOp.markAll(records, TAG_ALL); verify(filterRepository).store(new ...
public void markAll(Collection<Result> records, Tag tag) { for (Result result : records) { ImageRecord record = result.getImageRecord(); try { markAs(record, tag); logger.info("Adding pHash {} to filter, tag {}, source file {}", record.getpHash(), tag, record.getPath()); } catch (RepositoryException e) { logger.warn("F...
DuplicateOperations { public void markAll(Collection<Result> records, Tag tag) { for (Result result : records) { ImageRecord record = result.getImageRecord(); try { markAs(record, tag); logger.info("Adding pHash {} to filter, tag {}, source file {}", record.getpHash(), tag, record.getPath()); } catch (RepositoryExcepti...
DuplicateOperations { public void markAll(Collection<Result> records, Tag tag) { for (Result result : records) { ImageRecord record = result.getImageRecord(); try { markAs(record, tag); logger.info("Adding pHash {} to filter, tag {}, source file {}", record.getpHash(), tag, record.getPath()); } catch (RepositoryExcepti...
DuplicateOperations { public void markAll(Collection<Result> records, Tag tag) { for (Result result : records) { ImageRecord record = result.getImageRecord(); try { markAs(record, tag); logger.info("Adding pHash {} to filter, tag {}, source file {}", record.getpHash(), tag, record.getPath()); } catch (RepositoryExcepti...
DuplicateOperations { public void markAll(Collection<Result> records, Tag tag) { for (Result result : records) { ImageRecord record = result.getImageRecord(); try { markAs(record, tag); logger.info("Adding pHash {} to filter, tag {}, source file {}", record.getpHash(), tag, record.getPath()); } catch (RepositoryExcepti...
@Test public void testFindMissingFiles() throws Exception { Path testFile = Files.createTempFile(tempDirectory, "findmissingfilestest", null); ImageRecord missingRecord = new ImageRecord(testFile.getParent().resolve("foo").toString(), 0); when(imageRepository.startsWithPath(tempDirectory)) .thenReturn(Arrays.asList(new...
public List<ImageRecord> findMissingFiles(Path directory) { if (!isDirectory(directory)) { logger.error("Directory is null or missing, aborting"); return Collections.emptyList(); } if (!Files.exists(directory)) { logger.warn("Directory {} does not exist.", directory); } List<ImageRecord> records = Collections.emptyList...
DuplicateOperations { public List<ImageRecord> findMissingFiles(Path directory) { if (!isDirectory(directory)) { logger.error("Directory is null or missing, aborting"); return Collections.emptyList(); } if (!Files.exists(directory)) { logger.warn("Directory {} does not exist.", directory); } List<ImageRecord> records =...
DuplicateOperations { public List<ImageRecord> findMissingFiles(Path directory) { if (!isDirectory(directory)) { logger.error("Directory is null or missing, aborting"); return Collections.emptyList(); } if (!Files.exists(directory)) { logger.warn("Directory {} does not exist.", directory); } List<ImageRecord> records =...
DuplicateOperations { public List<ImageRecord> findMissingFiles(Path directory) { if (!isDirectory(directory)) { logger.error("Directory is null or missing, aborting"); return Collections.emptyList(); } if (!Files.exists(directory)) { logger.warn("Directory {} does not exist.", directory); } List<ImageRecord> records =...
DuplicateOperations { public List<ImageRecord> findMissingFiles(Path directory) { if (!isDirectory(directory)) { logger.error("Directory is null or missing, aborting"); return Collections.emptyList(); } if (!Files.exists(directory)) { logger.warn("Directory {} does not exist.", directory); } List<ImageRecord> records =...
@Test public void testIgnoreImage() throws Exception { dupOp.ignore(result); verify(ignoreRepository).store(new IgnoreRecord(result.getImageRecord())); }
public void ignore(Result result) { logger.info("Ignoring {}", result); try { ignoreRepository.store(new IgnoreRecord(result.getImageRecord())); } catch (RepositoryException e) { logger.error("Failed to store ignored image: {}, cause: {}", e.toString(), e.getCause().toString()); } }
DuplicateOperations { public void ignore(Result result) { logger.info("Ignoring {}", result); try { ignoreRepository.store(new IgnoreRecord(result.getImageRecord())); } catch (RepositoryException e) { logger.error("Failed to store ignored image: {}, cause: {}", e.toString(), e.getCause().toString()); } } }
DuplicateOperations { public void ignore(Result result) { logger.info("Ignoring {}", result); try { ignoreRepository.store(new IgnoreRecord(result.getImageRecord())); } catch (RepositoryException e) { logger.error("Failed to store ignored image: {}, cause: {}", e.toString(), e.getCause().toString()); } } @Inject Dupli...
DuplicateOperations { public void ignore(Result result) { logger.info("Ignoring {}", result); try { ignoreRepository.store(new IgnoreRecord(result.getImageRecord())); } catch (RepositoryException e) { logger.error("Failed to store ignored image: {}, cause: {}", e.toString(), e.getCause().toString()); } } @Inject Dupli...
DuplicateOperations { public void ignore(Result result) { logger.info("Ignoring {}", result); try { ignoreRepository.store(new IgnoreRecord(result.getImageRecord())); } catch (RepositoryException e) { logger.error("Failed to store ignored image: {}, cause: {}", e.toString(), e.getCause().toString()); } } @Inject Dupli...
@Test public void testGetHammingDistance() throws Exception { assertThat(CompareHammingDistance.getHammingDistance(2L, 3L), is(1)); }
protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } @Override double eval(Long e1, Long e2); }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } @Override double eval(Long e1, Long e2); }
@Test public void testGetHammingDistance2() throws Exception { assertThat(CompareHammingDistance.getHammingDistance(2L, 4L), is(2)); }
protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } @Override double eval(Long e1, Long e2); }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } @Override double eval(Long e1, Long e2); }
@Test public void testGetHammingDistance3() throws Exception { assertThat(CompareHammingDistance.getHammingDistance(3L, 5L), is(2)); }
protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } @Override double eval(Long e1, Long e2); }
CompareHammingDistance implements Distance<Long> { protected static int getHammingDistance(long a, long b) { long xor = a ^ b; int distance = Long.bitCount(xor); return distance; } @Override double eval(Long e1, Long e2); }
@Test public void testEvalDistanceAxiom1() throws Exception { assertThat(chd.eval(a, c), is(0.0)); assertThat(a, is(c)); }
@Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } @Override double eval(Long e1, Long e2); }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } @Override double eval(Long e1, Long e2); }
@Test public void testEvalDistanceAxiom2() throws Exception { double ab, ba; ab = chd.eval(a, b); ba = chd.eval(b, a); assertThat(ab, is(ba)); }
@Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } @Override double eval(Long e1, Long e2); }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } @Override double eval(Long e1, Long e2); }
@Test public void testEvalDistanceAxiom3() throws Exception { double ad, ab, bd; ab = chd.eval(a, b); ad = chd.eval(a, d); bd = chd.eval(b, d); assertThat(ad, is(lessThanOrEqualTo(ab + bd))); }
@Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } @Override double eval(Long e1, Long e2); }
CompareHammingDistance implements Distance<Long> { @Override public double eval(Long e1, Long e2) { int distance = getHammingDistance(e1, e2); return distance; } @Override double eval(Long e1, Long e2); }
@Test public void testAreAttributesValidHashAndTimestampOK() throws Exception { ExtendedAttribute.setExtendedAttribute(tempFile, testHashFullName, Long.toString(TEST_VALUE)); long timestamp = Files.getLastModifiedTime(tempFile).toMillis(); ExtendedAttribute.setExtendedAttribute(tempFile, timestampFullName, Long.toStrin...
public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; }
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } }
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } HashAttribute(String hashName); }
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } HashAttribute(String hashName); boolean areAttri...
HashAttribute { public boolean areAttributesValid(Path path) { try { return ExtendedAttribute.isExtendedAttributeSet(path, hashFQN) && verifyTimestamp(path); } catch (IOException e) { LOGGER.error("Failed to check hash for {} ({})", path, e.toString()); } return false; } HashAttribute(String hashName); boolean areAttri...
@Test public void testIsNoWorkersMode() throws Exception { assertThat(SimilarImage.isNoWorkersMode(noWorkersArgs), is(true)); }
protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } static void main(String[] args); void init(boolean noWorkers); }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } static void main(String[] args); void init(boolean noWorkers); }
@Test public void testIsLocalMode() throws Exception { assertThat(SimilarImage.isNoWorkersMode(localModeArgs), is(false)); }
protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } static void main(String[] args); void init(boolean noWorkers); }
SimilarImage { protected static boolean isNoWorkersMode(Namespace args) { return args.getBoolean("no_workers"); } static void main(String[] args); void init(boolean noWorkers); }
@Test public void testGetPath() throws Exception { assertThat(imageInfo.getPath(), is(testImage)); }
public Path getPath() { return path; }
ImageInfo { public Path getPath() { return path; } }
ImageInfo { public Path getPath() { return path; } ImageInfo(Path path, long pHash); }
ImageInfo { public Path getPath() { return path; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public Path getPath() { return path; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetPathInvalidImage() throws Exception { assertThat(imageInfoInvalid.getPath(), is(invalidImage)); }
public Path getPath() { return path; }
ImageInfo { public Path getPath() { return path; } }
ImageInfo { public Path getPath() { return path; } ImageInfo(Path path, long pHash); }
ImageInfo { public Path getPath() { return path; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public Path getPath() { return path; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetDimension() throws Exception { assertThat(imageInfo.getDimension(), is(new Dimension(40, 40))); }
public Dimension getDimension() { return dimension; }
ImageInfo { public Dimension getDimension() { return dimension; } }
ImageInfo { public Dimension getDimension() { return dimension; } ImageInfo(Path path, long pHash); }
ImageInfo { public Dimension getDimension() { return dimension; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public Dimension getDimension() { return dimension; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetDimensionInvalidImage() throws Exception { assertThat(imageInfoInvalid.getDimension(), is(new Dimension(0, 0))); }
public Dimension getDimension() { return dimension; }
ImageInfo { public Dimension getDimension() { return dimension; } }
ImageInfo { public Dimension getDimension() { return dimension; } ImageInfo(Path path, long pHash); }
ImageInfo { public Dimension getDimension() { return dimension; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public Dimension getDimension() { return dimension; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetSize() throws Exception { assertThat(imageInfo.getSize(), is(1782L)); }
public long getSize() { return size; }
ImageInfo { public long getSize() { return size; } }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetSizeInvalidImage() throws Exception { assertThat(imageInfoInvalid.getSize(), is(-1L)); }
public long getSize() { return size; }
ImageInfo { public long getSize() { return size; } }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetSizeInvalidFile() throws Exception { ImageInfo info = new ImageInfo(Paths.get("foo"), 2); assertThat(info.getSize(), is(-1L)); }
public long getSize() { return size; }
ImageInfo { public long getSize() { return size; } }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public long getSize() { return size; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetpHash() throws Exception { assertThat(imageInfo.getpHash(), is(42L)); }
public long getpHash() { return pHash; }
ImageInfo { public long getpHash() { return pHash; } }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test(expected = InvalidAttributeValueException.class) public void testReadHashInvalidFile() throws Exception { cut.readHash(fs.getPath(INVALID_FILE_PATH)); }
public long readHash(Path path) throws InvalidAttributeValueException, IOException { if (!areAttributesValid(path)) { throw new InvalidAttributeValueException("The required attributes are not set or invalid"); } String encodedHash = ExtendedAttribute.readExtendedAttributeAsString(path, hashFQN); return Long.parseUnsign...
HashAttribute { public long readHash(Path path) throws InvalidAttributeValueException, IOException { if (!areAttributesValid(path)) { throw new InvalidAttributeValueException("The required attributes are not set or invalid"); } String encodedHash = ExtendedAttribute.readExtendedAttributeAsString(path, hashFQN); return ...
HashAttribute { public long readHash(Path path) throws InvalidAttributeValueException, IOException { if (!areAttributesValid(path)) { throw new InvalidAttributeValueException("The required attributes are not set or invalid"); } String encodedHash = ExtendedAttribute.readExtendedAttributeAsString(path, hashFQN); return ...
HashAttribute { public long readHash(Path path) throws InvalidAttributeValueException, IOException { if (!areAttributesValid(path)) { throw new InvalidAttributeValueException("The required attributes are not set or invalid"); } String encodedHash = ExtendedAttribute.readExtendedAttributeAsString(path, hashFQN); return ...
HashAttribute { public long readHash(Path path) throws InvalidAttributeValueException, IOException { if (!areAttributesValid(path)) { throw new InvalidAttributeValueException("The required attributes are not set or invalid"); } String encodedHash = ExtendedAttribute.readExtendedAttributeAsString(path, hashFQN); return ...
@Test public void testGetpHashInvalidImage() throws Exception { assertThat(imageInfoInvalid.getpHash(), is(0L)); }
public long getpHash() { return pHash; }
ImageInfo { public long getpHash() { return pHash; } }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetpHashInvalidFile() throws Exception { ImageInfo info = new ImageInfo(Paths.get("foo"), 2); assertThat(info.getpHash(), is(2L)); }
public long getpHash() { return pHash; }
ImageInfo { public long getpHash() { return pHash; } }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public long getpHash() { return pHash; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetSizePerPixel() throws Exception { assertThat(imageInfo.getSizePerPixel(), is(1.11375)); }
public double getSizePerPixel() { return sizePerPixel; }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } ImageInfo(Path path, long pHash); }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testGetSizePerPixelInvalidImage() throws Exception { assertThat(imageInfoInvalid.getSizePerPixel(), is(0.0)); }
public double getSizePerPixel() { return sizePerPixel; }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } ImageInfo(Path path, long pHash); }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
ImageInfo { public double getSizePerPixel() { return sizePerPixel; } ImageInfo(Path path, long pHash); Path getPath(); Dimension getDimension(); long getSize(); long getpHash(); double getSizePerPixel(); }
@Test public void testSetView() throws Exception { cut.setView(ignoredImageView); verify(ignoredImageView, timeout(CONCURRENT_TIMEOUT)).pack(); }
public void setView(IgnoredImageView view) { this.view = view; refreshList(); }
IgnoredImagePresenter { public void setView(IgnoredImageView view) { this.view = view; refreshList(); } }
IgnoredImagePresenter { public void setView(IgnoredImageView view) { this.view = view; refreshList(); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); }
IgnoredImagePresenter { public void setView(IgnoredImageView view) { this.view = view; refreshList(); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> getModel(); void refreshList(); void removeIgnoredImages(List<IgnoreRecord> toRemove); }
IgnoredImagePresenter { public void setView(IgnoredImageView view) { this.view = view; refreshList(); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> getModel(); void refreshList(); void removeIgnoredImages(List<IgnoreRecord> toRemove); }
@Test public void testGetModel() throws Exception { assertThat(cut.getModel(), is(not(nullValue()))); }
public DefaultListModel<IgnoreRecord> getModel() { return model; }
IgnoredImagePresenter { public DefaultListModel<IgnoreRecord> getModel() { return model; } }
IgnoredImagePresenter { public DefaultListModel<IgnoreRecord> getModel() { return model; } IgnoredImagePresenter(IgnoreRepository ignoreRepository); }
IgnoredImagePresenter { public DefaultListModel<IgnoreRecord> getModel() { return model; } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> getModel(); void refreshList(); void removeIgnoredImages(List<IgnoreRecord> toRemove); }
IgnoredImagePresenter { public DefaultListModel<IgnoreRecord> getModel() { return model; } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> getModel(); void refreshList(); void removeIgnoredImages(List<IgnoreRecord> toRemove); }
@Test public void testRefreshList() throws Exception { cut.setView(ignoredImageView); cut.refreshList(); Awaitility.await().atMost(CONCURRENT_TIMEOUT, TimeUnit.MILLISECONDS).until(() -> cut.getModel().getSize(), is(2)); }
public void refreshList() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { model.clear(); try { ignoreRepository.getAll().forEach(new Consumer<IgnoreRecord>() { @Override public void accept(IgnoreRecord t) { model.addElement(t); } }); } catch (RepositoryException e) { LOGGER.error("Failed to ...
IgnoredImagePresenter { public void refreshList() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { model.clear(); try { ignoreRepository.getAll().forEach(new Consumer<IgnoreRecord>() { @Override public void accept(IgnoreRecord t) { model.addElement(t); } }); } catch (RepositoryException e) { ...
IgnoredImagePresenter { public void refreshList() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { model.clear(); try { ignoreRepository.getAll().forEach(new Consumer<IgnoreRecord>() { @Override public void accept(IgnoreRecord t) { model.addElement(t); } }); } catch (RepositoryException e) { ...
IgnoredImagePresenter { public void refreshList() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { model.clear(); try { ignoreRepository.getAll().forEach(new Consumer<IgnoreRecord>() { @Override public void accept(IgnoreRecord t) { model.addElement(t); } }); } catch (RepositoryException e) { ...
IgnoredImagePresenter { public void refreshList() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { model.clear(); try { ignoreRepository.getAll().forEach(new Consumer<IgnoreRecord>() { @Override public void accept(IgnoreRecord t) { model.addElement(t); } }); } catch (RepositoryException e) { ...
@Test public void testRemoveIgnoredImages() throws Exception { cut.removeIgnoredImages(Arrays.asList(ignoreA)); verify(ignoreRepository).remove(ignoreA); }
public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); }
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } }
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); }
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> g...
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> g...
@Test public void testRemoveIgnoredImagesWithRepositoryError() throws Exception { Mockito.doThrow(new RepositoryException("")).when(ignoreRepository).remove(ignoreA); cut.removeIgnoredImages(Arrays.asList(ignoreA, ignoreB)); verify(ignoreRepository, times(2)).remove(any()); }
public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); }
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } }
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); }
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> g...
IgnoredImagePresenter { public void removeIgnoredImages(List<IgnoreRecord> toRemove) { LOGGER.info("Removing {} ignored images", toRemove.size()); toRemove.forEach(this::removeIgnoredImage); } IgnoredImagePresenter(IgnoreRepository ignoreRepository); void setView(IgnoredImageView view); DefaultListModel<IgnoreRecord> g...
@Test public void testLoadImage() throws Exception { assertThat(cut.load(key), is(notNullValue())); }
@Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); }
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } }
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } }
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } @Override BufferedImage load(Result key); ...
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } @Override BufferedImage load(Result key); ...
@Test public void testGetHashFQN() throws Exception { assertThat(cut.getHashFQN(), is(ExtendedAttribute.createName("hash", TEST_HASH_NAME))); }
public String getHashFQN() { return hashFQN; }
HashAttribute { public String getHashFQN() { return hashFQN; } }
HashAttribute { public String getHashFQN() { return hashFQN; } HashAttribute(String hashName); }
HashAttribute { public String getHashFQN() { return hashFQN; } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCorrupted(Path path); String getHashFQN(); String getTimestampFQN(); String getCo...
HashAttribute { public String getHashFQN() { return hashFQN; } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCorrupted(Path path); String getHashFQN(); String getTimestampFQN(); String getCo...
@Test(expected = NoSuchFileException.class) public void testLoadInvalidPath() throws Exception { assertThat(cut.load(invalidImagePath), is(notNullValue())); }
@Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); }
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } }
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } }
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } @Override BufferedImage load(Result key); ...
ThumbnailCacheLoader extends CacheLoader<Result, BufferedImage> { @Override public BufferedImage load(Result key) throws Exception { BufferedImage bi = ImageUtil.loadImage(Paths.get(key.getImageRecord().getPath())); return Scalr.resize(bi, Method.AUTOMATIC, THUMBNAIL_SIZE); } @Override BufferedImage load(Result key); ...
@Test public void testGetImagePath() throws Exception { assertThat(duplicateEntryController.getImagePath(), is(Paths.get(testImage.toString()))); }
public Path getImagePath() { return imageInfo.getPath(); }
ResultPresenter { public Path getImagePath() { return imageInfo.getPath(); } }
ResultPresenter { public Path getImagePath() { return imageInfo.getPath(); } ResultPresenter(Result result, LoadingCache<Result, BufferedImage> thumbnailCache); }
ResultPresenter { public Path getImagePath() { return imageInfo.getPath(); } ResultPresenter(Result result, LoadingCache<Result, BufferedImage> thumbnailCache); Path getImagePath(); void displayFullImage(); void setView(ResultView view); }
ResultPresenter { public Path getImagePath() { return imageInfo.getPath(); } ResultPresenter(Result result, LoadingCache<Result, BufferedImage> thumbnailCache); Path getImagePath(); void displayFullImage(); void setView(ResultView view); }
@Test public void testSetView() throws Exception { verify(view).setImage(any(JLabel.class)); verify(view).createLable(eq("Path: " + testImage.toString())); verify(view).createLable(eq("Size: 1 kb")); verify(view).createLable(eq("Dimension: 40x40")); verify(view).createLable(eq("pHash: 42")); verify(view).createLable(eq...
public void setView(ResultView view) { this.view = view; loadThumbnail(); addImageInfo(); }
ResultPresenter { public void setView(ResultView view) { this.view = view; loadThumbnail(); addImageInfo(); } }
ResultPresenter { public void setView(ResultView view) { this.view = view; loadThumbnail(); addImageInfo(); } ResultPresenter(Result result, LoadingCache<Result, BufferedImage> thumbnailCache); }
ResultPresenter { public void setView(ResultView view) { this.view = view; loadThumbnail(); addImageInfo(); } ResultPresenter(Result result, LoadingCache<Result, BufferedImage> thumbnailCache); Path getImagePath(); void displayFullImage(); void setView(ResultView view); }
ResultPresenter { public void setView(ResultView view) { this.view = view; loadThumbnail(); addImageInfo(); } ResultPresenter(Result result, LoadingCache<Result, BufferedImage> thumbnailCache); Path getImagePath(); void displayFullImage(); void setView(ResultView view); }
@Test public void testDisplayFullImage() throws Exception { duplicateEntryController.displayFullImage(); verify(view).displayFullImage(any(JLabel.class), eq(testImage)); }
public void displayFullImage() { JLabel largeImage = new JLabel("No Image"); try { BufferedImage bi = ImageUtil.loadImage(getImagePath()); largeImage = imageAsLabel(bi); } catch (Exception e) { LOGGER.warn("Unable to load full image {} - {}", getImagePath(), e.getMessage()); } view.displayFullImage(largeImage, getImage...
ResultPresenter { public void displayFullImage() { JLabel largeImage = new JLabel("No Image"); try { BufferedImage bi = ImageUtil.loadImage(getImagePath()); largeImage = imageAsLabel(bi); } catch (Exception e) { LOGGER.warn("Unable to load full image {} - {}", getImagePath(), e.getMessage()); } view.displayFullImage(la...
ResultPresenter { public void displayFullImage() { JLabel largeImage = new JLabel("No Image"); try { BufferedImage bi = ImageUtil.loadImage(getImagePath()); largeImage = imageAsLabel(bi); } catch (Exception e) { LOGGER.warn("Unable to load full image {} - {}", getImagePath(), e.getMessage()); } view.displayFullImage(la...
ResultPresenter { public void displayFullImage() { JLabel largeImage = new JLabel("No Image"); try { BufferedImage bi = ImageUtil.loadImage(getImagePath()); largeImage = imageAsLabel(bi); } catch (Exception e) { LOGGER.warn("Unable to load full image {} - {}", getImagePath(), e.getMessage()); } view.displayFullImage(la...
ResultPresenter { public void displayFullImage() { JLabel largeImage = new JLabel("No Image"); try { BufferedImage bi = ImageUtil.loadImage(getImagePath()); largeImage = imageAsLabel(bi); } catch (Exception e) { LOGGER.warn("Unable to load full image {} - {}", getImagePath(), e.getMessage()); } view.displayFullImage(la...
@Test public void testProcessedFileFoundCountForNonImage() throws Exception { cut.visitFile(pathNonImage, null); assertThat(foundFiles.getCount(), is(0L)); }
@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (!imageFileFilter.accept(file)) { return FileVisitResult.CONTINUE; } foundFiles.inc(); filesPerSecond.mark(); if (hashAttribute.isCorrupted(file)) { failedFiles.inc(); } else if (hashAttribute.areAttributesValid(fil...
ProgressVisitor extends SimpleFileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (!imageFileFilter.accept(file)) { return FileVisitResult.CONTINUE; } foundFiles.inc(); filesPerSecond.mark(); if (hashAttribute.isCorrupted(file)) { failedFiles.inc(...
ProgressVisitor extends SimpleFileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (!imageFileFilter.accept(file)) { return FileVisitResult.CONTINUE; } foundFiles.inc(); filesPerSecond.mark(); if (hashAttribute.isCorrupted(file)) { failedFiles.inc(...
ProgressVisitor extends SimpleFileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (!imageFileFilter.accept(file)) { return FileVisitResult.CONTINUE; } foundFiles.inc(); filesPerSecond.mark(); if (hashAttribute.isCorrupted(file)) { failedFiles.inc(...
ProgressVisitor extends SimpleFileVisitor<Path> { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (!imageFileFilter.accept(file)) { return FileVisitResult.CONTINUE; } foundFiles.inc(); filesPerSecond.mark(); if (hashAttribute.isCorrupted(file)) { failedFiles.inc(...
@Test(expected = ArgumentParserException.class) public void testParseArgsInvalidOption() throws Exception { cut.parseArgs(new String[] { LOCAL_SUBCOMMAND, "--foo" }); }
public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } }
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } }
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
@Test public void testParseArgsUpdateOption() throws Exception { cut.parseArgs(new String[] { LOCAL_SUBCOMMAND, "--update", "foo" }); }
public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } }
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } }
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
@Test public void testParseArgsNodeOption() throws Exception { cut.parseArgs(new String[] { NODE_SUBCOMMAND, "--port", "123" }); }
public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } }
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } }
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
ArgumentPasrser { public void parseArgs(String[] args) throws ArgumentParserException { Namespace parsedArgs = parser.parseArgs(args); if (parsedArgs.get("subcommand") == Subcommand.local) { localCommand(parsedArgs); } if (parsedArgs.get("subcommand") == Subcommand.node) { nodeCommand(parsedArgs); } } ArgumentPasrser(F...
@Test public void testTotalProgressPercent() throws Exception { assertThat(cut.totalProgressPercent(), closeTo(TOTAL_PROGRESS_PERCENT, ALLOWED_COMAPRE_ERROR)); }
public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } }
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } }
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } ProgressCalc(MetricRegistry metrics); }
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override Stri...
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override Stri...
@Test public void testTotalProgressPercentWithNoFiles() throws Exception { setCounter(ProgressCalc.METRIC_NAME_FOUND, 0); setCounter(ProgressCalc.METRIC_NAME_PROCESSED, 0); assertThat(cut.totalProgressPercent(), is(0.0)); }
public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } }
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } }
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } ProgressCalc(MetricRegistry metrics); }
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override Stri...
ProgressCalc { public double totalProgressPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * (processedFiles.getCount() + failedFiles.getCount()); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override Stri...
@Test public void testGetTimestampFQN() throws Exception { assertThat(cut.getTimestampFQN(), is(ExtendedAttribute.createName("timestamp", TEST_HASH_NAME))); }
public String getTimestampFQN() { return timestampFQN; }
HashAttribute { public String getTimestampFQN() { return timestampFQN; } }
HashAttribute { public String getTimestampFQN() { return timestampFQN; } HashAttribute(String hashName); }
HashAttribute { public String getTimestampFQN() { return timestampFQN; } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCorrupted(Path path); String getHashFQN(); String getTimestampFQN(); St...
HashAttribute { public String getTimestampFQN() { return timestampFQN; } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCorrupted(Path path); String getHashFQN(); String getTimestampFQN(); St...
@Test public void testCorruptPercent() throws Exception { assertThat(cut.corruptPercent(), closeTo(CORRUPT_PERCENT, ALLOWED_COMAPRE_ERROR)); }
public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } ProgressCalc(MetricRegistry metrics); }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override String toString(); }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override String toString(); static final String M...
@Test public void testCorruptPercentWithNoFiles() throws Exception { setCounter(ProgressCalc.METRIC_NAME_FOUND, 0); setCounter(ProgressCalc.METRIC_NAME_FAILED, 0); assertThat(cut.corruptPercent(), is(0.0)); }
public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } ProgressCalc(MetricRegistry metrics); }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override String toString(); }
ProgressCalc { public double corruptPercent() { if (foundFiles.getCount() == 0) { return 0; } else { return (PERCENT_100 / foundFiles.getCount()) * failedFiles.getCount(); } } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPercent(); @Override String toString(); static final String M...
@Test public void testToString() throws Exception { assertThat(cut.toString(), is("Total progress: 23.81%, corrupt images: 9.52%, files per second processed: 0.00")); }
@Override public String toString() { return String.format("Total progress: %.2f%%, corrupt images: %.2f%%, files per second processed: %.2f", totalProgressPercent(), corruptPercent(), filesPerSecond.getMeanRate()); }
ProgressCalc { @Override public String toString() { return String.format("Total progress: %.2f%%, corrupt images: %.2f%%, files per second processed: %.2f", totalProgressPercent(), corruptPercent(), filesPerSecond.getMeanRate()); } }
ProgressCalc { @Override public String toString() { return String.format("Total progress: %.2f%%, corrupt images: %.2f%%, files per second processed: %.2f", totalProgressPercent(), corruptPercent(), filesPerSecond.getMeanRate()); } ProgressCalc(MetricRegistry metrics); }
ProgressCalc { @Override public String toString() { return String.format("Total progress: %.2f%%, corrupt images: %.2f%%, files per second processed: %.2f", totalProgressPercent(), corruptPercent(), filesPerSecond.getMeanRate()); } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPerce...
ProgressCalc { @Override public String toString() { return String.format("Total progress: %.2f%%, corrupt images: %.2f%%, files per second processed: %.2f", totalProgressPercent(), corruptPercent(), filesPerSecond.getMeanRate()); } ProgressCalc(MetricRegistry metrics); double totalProgressPercent(); double corruptPerce...
@Test public void testHashRequestMessageTrackingId() throws Exception { ClientMessage result = cut.hashRequestMessage(IMAGE_DATA, UUID); UUID id = new UUID(result.getBodyBuffer().readLong(), result.getBodyBuffer().readLong()); assertThat(id, is(UUID)); }
public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedImage); return mes...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
@Test public void testHashRequestMessageImageData() throws Exception { ClientMessage result = cut.hashRequestMessage(IMAGE_DATA, UUID); result.getBodyBuffer().readLong(); result.getBodyBuffer().readLong(); byte[] data = new byte[IMAGE_DATA.length]; result.getBodyBuffer().readBytes(data); assertArrayEquals(data, IMAGE_D...
public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedImage); return mes...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
@Test public void testHashRequestMessageImageSize() throws Exception { ClientMessage result = cut.hashRequestMessage(IMAGE_DATA, UUID); result.getBodyBuffer().readLong(); result.getBodyBuffer().readLong(); byte[] data = new byte[result.getBodySize()]; result.getBodyBuffer().readBytes(data); assertArrayEquals(data, IMAG...
public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedImage); return mes...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
MessageFactory { public ClientMessage hashRequestMessage(byte[] resizedImage, UUID uuid) { ClientMessage message = session.createMessage(true); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); message.getBodyBuffer().writeBytes(resizedI...
@Test public void testResultMessageTask() throws Exception { ClientMessage result = cut.resultMessage(HASH, UUID.getMostSignificantBits(), UUID.getLeastSignificantBits()); assertThat(result.getStringProperty(MessageProperty.task.toString()), is(TaskType.result.toString())); }
public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; }
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
@Test public void testResultMessageUuid() throws Exception { ClientMessage result = cut.resultMessage(HASH, UUID.getMostSignificantBits(), UUID.getLeastSignificantBits()); UUID id = new UUID(result.getBodyBuffer().readLong(), result.getBodyBuffer().readLong()); assertThat(id, is(UUID)); }
public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; }
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
@Test public void testResultMessageHash() throws Exception { ClientMessage result = cut.resultMessage(HASH, UUID.getMostSignificantBits(), UUID.getLeastSignificantBits()); result.getBodyBuffer().readLong(); result.getBodyBuffer().readLong(); long hash = result.getBodyBuffer().readLong(); assertThat(hash, is(HASH)); }
public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; }
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
MessageFactory { public ClientMessage resultMessage(long hash, long most, long least) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.result); ActiveMQBuffer buffer = message.getBodyBuffer(); buffer.writeLong(most); buffer.writeLong(least); buffer.writeLong(hash); return message; } ...
@Test public void testPendingImageQuery() throws Exception { ClientMessage result = cut.pendingImageQuery(); assertThat(result.getStringProperty(MessageFactory.MessageProperty.repository_query.toString()), is(MessageFactory.QueryType.pending.toString())); }
public ClientMessage pendingImageQuery() { ClientMessage message = session.createMessage(false); message.putStringProperty(MessageProperty.repository_query.toString(), QueryType.pending.toString()); return message; }
MessageFactory { public ClientMessage pendingImageQuery() { ClientMessage message = session.createMessage(false); message.putStringProperty(MessageProperty.repository_query.toString(), QueryType.pending.toString()); return message; } }
MessageFactory { public ClientMessage pendingImageQuery() { ClientMessage message = session.createMessage(false); message.putStringProperty(MessageProperty.repository_query.toString(), QueryType.pending.toString()); return message; } MessageFactory(ClientSession session); }
MessageFactory { public ClientMessage pendingImageQuery() { ClientMessage message = session.createMessage(false); message.putStringProperty(MessageProperty.repository_query.toString(), QueryType.pending.toString()); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(byte[] resized...
MessageFactory { public ClientMessage pendingImageQuery() { ClientMessage message = session.createMessage(false); message.putStringProperty(MessageProperty.repository_query.toString(), QueryType.pending.toString()); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(byte[] resized...
@Test public void testMarkCorrupted() throws Exception { cut.markCorrupted(tempFile); assertThat(ExtendedAttribute.isExtendedAttributeSet(tempFile, cut.getCorruptNameFQN()), is(true)); }
public void markCorrupted(Path path) throws IOException { ExtendedAttribute.setExtendedAttribute(path, corruptNameFQN, ""); }
HashAttribute { public void markCorrupted(Path path) throws IOException { ExtendedAttribute.setExtendedAttribute(path, corruptNameFQN, ""); } }
HashAttribute { public void markCorrupted(Path path) throws IOException { ExtendedAttribute.setExtendedAttribute(path, corruptNameFQN, ""); } HashAttribute(String hashName); }
HashAttribute { public void markCorrupted(Path path) throws IOException { ExtendedAttribute.setExtendedAttribute(path, corruptNameFQN, ""); } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCo...
HashAttribute { public void markCorrupted(Path path) throws IOException { ExtendedAttribute.setExtendedAttribute(path, corruptNameFQN, ""); } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCo...
@Test public void testTransformDCT2() throws Exception { double[] result = cut.transformDCT(Doubles.concat(testMatrix2)); assertArrayEquals(EXPECTED2, Doubles.concat(result), 0.1); }
public synchronized double[] transformDCT(double[] matrix) { for (int i = 0; i < matrixArea; i++) { this.matrix[i] = matrix[i]; } execute(range); return Doubles.concat(result); }
DCTKernel extends Kernel { public synchronized double[] transformDCT(double[] matrix) { for (int i = 0; i < matrixArea; i++) { this.matrix[i] = matrix[i]; } execute(range); return Doubles.concat(result); } }
DCTKernel extends Kernel { public synchronized double[] transformDCT(double[] matrix) { for (int i = 0; i < matrixArea; i++) { this.matrix[i] = matrix[i]; } execute(range); return Doubles.concat(result); } DCTKernel(); DCTKernel(int matrixSize); }
DCTKernel extends Kernel { public synchronized double[] transformDCT(double[] matrix) { for (int i = 0; i < matrixArea; i++) { this.matrix[i] = matrix[i]; } execute(range); return Doubles.concat(result); } DCTKernel(); DCTKernel(int matrixSize); void setDevice(Device device); @Override void run(); synchronized double[...
DCTKernel extends Kernel { public synchronized double[] transformDCT(double[] matrix) { for (int i = 0; i < matrixArea; i++) { this.matrix[i] = matrix[i]; } execute(range); return Doubles.concat(result); } DCTKernel(); DCTKernel(int matrixSize); void setDevice(Device device); @Override void run(); synchronized double[...
@Test public void testPendingImageResponse() throws Exception { ClientMessage result = cut.pendingImageResponse(Arrays.asList(new PendingHashImage(PATH, UUID))); assertThat(result.getBodySize(), is(EXPECTED_MESSAGE_SIZE)); }
public ClientMessage pendingImageResponse(List<PendingHashImage> pendingImages) throws IOException { List<String> pendingPaths = new LinkedList<String>(); for (PendingHashImage p : pendingImages) { pendingPaths.add(p.getPath()); } try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = n...
MessageFactory { public ClientMessage pendingImageResponse(List<PendingHashImage> pendingImages) throws IOException { List<String> pendingPaths = new LinkedList<String>(); for (PendingHashImage p : pendingImages) { pendingPaths.add(p.getPath()); } try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOut...
MessageFactory { public ClientMessage pendingImageResponse(List<PendingHashImage> pendingImages) throws IOException { List<String> pendingPaths = new LinkedList<String>(); for (PendingHashImage p : pendingImages) { pendingPaths.add(p.getPath()); } try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOut...
MessageFactory { public ClientMessage pendingImageResponse(List<PendingHashImage> pendingImages) throws IOException { List<String> pendingPaths = new LinkedList<String>(); for (PendingHashImage p : pendingImages) { pendingPaths.add(p.getPath()); } try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOut...
MessageFactory { public ClientMessage pendingImageResponse(List<PendingHashImage> pendingImages) throws IOException { List<String> pendingPaths = new LinkedList<String>(); for (PendingHashImage p : pendingImages) { pendingPaths.add(p.getPath()); } try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOut...
@Test public void testCorruptMessagePath() throws Exception { ClientMessage result = cut.corruptMessage(PATH); assertThat(result.getStringProperty(MessageProperty.path.toString()), is(PATH.toString())); }
public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; }
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } }
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } MessageFactory(Clien...
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } MessageFactory(Clien...
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } MessageFactory(Clien...
@Test public void testCorruptMessageTask() throws Exception { ClientMessage result = cut.corruptMessage(PATH); assertThat(result.getStringProperty(MessageProperty.task.toString()), is(TaskType.corr.toString())); }
public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; }
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } }
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } MessageFactory(Clien...
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } MessageFactory(Clien...
MessageFactory { public ClientMessage corruptMessage(Path path) { ClientMessage message = session.createMessage(true); message.putStringProperty(MessageProperty.path.toString(), path.toString()); message.putStringProperty(MessageProperty.task.toString(), TaskType.corr.toString()); return message; } MessageFactory(Clien...
@Test public void testEaUpdatePath() throws Exception { ClientMessage result = cut.eaUpdate(PATH, HASH); assertThat(result.getStringProperty(MessageProperty.path.toString()), is(PATH.toString())); }
public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(...
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(...
@Test public void testEaUpdateHash() throws Exception { ClientMessage result = cut.eaUpdate(PATH, HASH); assertThat(result.getBodyBuffer().readLong(), is(HASH)); }
public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(...
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(...
@Test public void testEaUpdateTask() throws Exception { ClientMessage result = cut.eaUpdate(PATH, HASH); assertThat(result.getStringProperty(MessageProperty.task.toString()), is(TaskType.eaupdate.toString())); }
public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); }
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(...
MessageFactory { public ClientMessage eaUpdate(Path path, long hash) { ClientMessage message = session.createMessage(true); setTaskType(message, TaskType.eaupdate); setPath(message, path); message.getBodyBuffer().writeLong(hash); return message; } MessageFactory(ClientSession session); ClientMessage hashRequestMessage(...
@Test public void testResizeRequestPath() throws Exception { ClientMessage result = cut.resizeRequest(PATH, is); assertThat(result.getStringProperty(MessageProperty.path.toString()), is(PATH.toString())); }
public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; }
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } }
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } MessageFactory(ClientSession session); }
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } MessageFactory(ClientSession session); ClientMess...
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } MessageFactory(ClientSession session); ClientMess...
@Test public void testResizeRequestTask() throws Exception { ClientMessage result = cut.resizeRequest(PATH, is); assertThat(result.getStringProperty(MessageProperty.task.toString()), is(TaskType.hash.toString())); }
public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; }
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } }
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } MessageFactory(ClientSession session); }
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } MessageFactory(ClientSession session); ClientMess...
MessageFactory { public ClientMessage resizeRequest(Path path, InputStream is) throws IOException { ClientMessage message = session.createMessage(true); copyInputStreamToMessage(is, message); setTaskType(message, TaskType.hash); setPath(message, path); return message; } MessageFactory(ClientSession session); ClientMess...
@Test public void testTrackPathPathProperty() throws Exception { ClientMessage result = cut.trackPath(PATH, UUID); assertThat(result.getStringProperty(MessageProperty.path.toString()), is(PATH.toString())); }
public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); return message; ...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
@Test public void testTrackPathTaskProperty() throws Exception { ClientMessage result = cut.trackPath(PATH, UUID); assertThat(result.getStringProperty(MessageProperty.task.toString()), is(TaskType.track.toString())); }
public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); return message; ...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
@Test public void testGetCorruptNameFQN() throws Exception { assertThat(cut.getCorruptNameFQN(), is(ExtendedAttribute.createName("corrupt"))); }
public String getCorruptNameFQN() { return corruptNameFQN; }
HashAttribute { public String getCorruptNameFQN() { return corruptNameFQN; } }
HashAttribute { public String getCorruptNameFQN() { return corruptNameFQN; } HashAttribute(String hashName); }
HashAttribute { public String getCorruptNameFQN() { return corruptNameFQN; } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCorrupted(Path path); String getHashFQN(); String getTimestampFQN()...
HashAttribute { public String getCorruptNameFQN() { return corruptNameFQN; } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolean isCorrupted(Path path); String getHashFQN(); String getTimestampFQN()...
@Test public void testTrackPathMessageBody() throws Exception { ClientMessage result = cut.trackPath(PATH, UUID); long most = result.getBodyBuffer().readLong(); long least = result.getBodyBuffer().readLong(); assertThat(new UUID(most, least), is(UUID)); }
public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits()); return message; ...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
MessageFactory { public ClientMessage trackPath(Path path, UUID uuid) { ClientMessage message = session.createMessage(false); setTaskType(message, TaskType.track); setPath(message, path); message.getBodyBuffer().writeLong(uuid.getMostSignificantBits()); message.getBodyBuffer().writeLong(uuid.getLeastSignificantBits());...
@Test public void testOnDrainInTransaction() throws Exception { cut.onDrain(messages); verify(transactionManager).callInTransaction(any()); }
@Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Failed to store {} messages: {}", messages.size(), e.toString(), e....
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
@Test public void testMessageRollbackOnDatabaseFailure() throws Exception { when(transactionManager.callInTransaction(any())) .thenThrow(new SQLException(EXCEPTION_MESSAGE)); cut.onDrain(messages); verify(session).rollback(); }
@Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Failed to store {} messages: {}", messages.size(), e.toString(), e....
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
@Test(expected = RuntimeException.class) public void testMessageRollbackFailure() throws Exception { when(transactionManager.callInTransaction(any())).thenThrow(new SQLException(EXCEPTION_MESSAGE)); Mockito.doThrow(new ActiveMQException()).when(session).rollback(); cut.onDrain(messages); }
@Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Failed to store {} messages: {}", messages.size(), e.toString(), e....
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
QueueToDatabaseTransaction implements CollectedMessageConsumer { @Override public void onDrain(List<ClientMessage> messages) { try { transactionManager.callInTransaction(new Callable<Void>() { @Override public Void call() throws Exception { onCall(messages); return null; } }); } catch (SQLException e) { LOGGER.warn("Fa...
@Test public void testOnCallMessageAcknowledge() throws Exception { cut.onCall(messages); verify(message, times(TEST_MESSAGE_SIZE)).acknowledge(); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testOnCallPendingQuery() throws Exception { cut.onCall(messages); verify(pendingRepository).getByUUID(UUID_MOST, UUID_LEAST); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testOnCallPendingMessageMissing() throws Exception { when(pendingRepository.getByUUID(UUID_MOST, UUID_LEAST)).thenReturn(null); cut.onCall(messages); assertThat( metrics.getCounters().get(QueueToDatabaseTransaction.METRIC_NAME_PENDING_MESSAGES_MISSING).getCount(), is((long) TEST_MESSAGE_SIZE)); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testOnCallPendingMessagesDecrement() throws Exception { cut.onCall(messages); assertThat(metrics.getCounters().get(QueueToDatabaseTransaction.METRIC_NAME_PENDING_MESSAGES).getCount(), is(-1L)); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testOnCallProcessedMessagesIncrement() throws Exception { cut.onCall(messages); assertThat(metrics.getMeters().get(QueueToDatabaseTransaction.METRIC_NAME_PROCESSED_IMAGES).getCount(), is(1L)); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testOnCallResultStored() throws Exception { cut.onCall(messages); verify(imageRepository).store(eq(new ImageRecord(PATH, HASH))); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testIsCorruptedNotSet() throws Exception { assertThat(cut.isCorrupted(tempFile), is(false)); }
public boolean isCorrupted(Path path) throws IOException { return ExtendedAttribute.isExtendedAttributeSet(path, corruptNameFQN); }
HashAttribute { public boolean isCorrupted(Path path) throws IOException { return ExtendedAttribute.isExtendedAttributeSet(path, corruptNameFQN); } }
HashAttribute { public boolean isCorrupted(Path path) throws IOException { return ExtendedAttribute.isExtendedAttributeSet(path, corruptNameFQN); } HashAttribute(String hashName); }
HashAttribute { public boolean isCorrupted(Path path) throws IOException { return ExtendedAttribute.isExtendedAttributeSet(path, corruptNameFQN); } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolea...
HashAttribute { public boolean isCorrupted(Path path) throws IOException { return ExtendedAttribute.isExtendedAttributeSet(path, corruptNameFQN); } HashAttribute(String hashName); boolean areAttributesValid(Path path); long readHash(Path path); void writeHash(Path path, long hash); void markCorrupted(Path path); boolea...
@Test public void testOnCallPendingRemoved() throws Exception { cut.onCall(messages); verify(pendingRepository).remove(new PendingHashImage(PATH, UUID_MOST, UUID_LEAST)); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testOnCallEAupdateSent() throws Exception { cut.onCall(messages); verify(producer).send(sendMessage); }
protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } }
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
QueueToDatabaseTransaction implements CollectedMessageConsumer { protected void onCall(List<ClientMessage> messages) throws RepositoryException, ActiveMQException { for (ClientMessage message : messages) { processMessage(message); message.acknowledge(); } session.commit(); } QueueToDatabaseTransaction(ClientSession tra...
@Test public void testValidImageNotCorrupt() throws Exception { producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(hashRequests::size, is(1)); ClientMessage response = hashRequests.get(0); assertThat(response.containsProperty(MessageProperty.task.toString()), is(false)); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testValidImageTrackSent() throws Exception { producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(results::size, is(1)); ClientMessage response = results.get(0); assertThat(response.getStringProperty(MessageProperty.task.toString()), is(TaskType.track.toString())); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testCorruptImageDataTaskProperty() throws Exception { when(resizer.resize(nullable(BufferedImage.class))).thenThrow(new IIOException("")); producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(eaUpdates::size, is(1)); ClientMessage response = eaUpdates.get(0); assertThat(response.getStringProp...
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testCorruptImageDataPathProperty() throws Exception { when(resizer.resize(nullable(BufferedImage.class))).thenThrow(new IIOException("")); producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(eaUpdates::size, is(1)); ClientMessage response = eaUpdates.get(0); assertThat(response.getStringProp...
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testGIFerrorUnknownBlock() throws Exception { when(resizer.resize(nullable(BufferedImage.class))).thenThrow(new IOException("Unknown block")); producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(eaUpdates::size, is(1)); ClientMessage response = eaUpdates.get(0); assertThat(response.getString...
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testGIFerrorInvalidHeader() throws Exception { when(resizer.resize(nullable(BufferedImage.class))).thenThrow(new IOException("Invalid GIF header")); producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(eaUpdates::size, is(1)); ClientMessage response = eaUpdates.get(0); assertThat(response.get...
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testBufferResize() throws Exception { for (byte i = 0; i < BUFFER_TEST_DATA_SIZE; i++) { message.getBodyBuffer().writeByte(i); } cut.allocateNewBuffer(1); producer.send(message); await().atMost(MESSAGE_TIMEOUT).until(() -> metrics.getCounters().get(ResizerNode.METRIC_NAME_BUFFER_RESIZE).getCount(), is...
protected void allocateNewBuffer(int messageSize) { messageBuffer = ByteBuffer.allocateDirect(calcNewBufferSize(messageSize)); }
ResizerNode implements MessageHandler, Node { protected void allocateNewBuffer(int messageSize) { messageBuffer = ByteBuffer.allocateDirect(calcNewBufferSize(messageSize)); } }
ResizerNode implements MessageHandler, Node { protected void allocateNewBuffer(int messageSize) { messageBuffer = ByteBuffer.allocateDirect(calcNewBufferSize(messageSize)); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRegistry metrics); protected ResizerNode(ClientSession session, ImageRes...
ResizerNode implements MessageHandler, Node { protected void allocateNewBuffer(int messageSize) { messageBuffer = ByteBuffer.allocateDirect(calcNewBufferSize(messageSize)); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRegistry metrics); protected ResizerNode(ClientSession session, ImageRes...
ResizerNode implements MessageHandler, Node { protected void allocateNewBuffer(int messageSize) { messageBuffer = ByteBuffer.allocateDirect(calcNewBufferSize(messageSize)); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRegistry metrics); protected ResizerNode(ClientSession session, ImageRes...
@Test public void testImageSizeHistogramCount() throws Exception { message = new MessageFactory(session).resizeRequest(Paths.get(PATH_NEW), is); for (byte i = 0; i < BUFFER_TEST_DATA_SIZE; i++) { message.getBodyBuffer().writeByte(i); } cut.onMessage(message); assertThat(metrics.getHistograms().get(ResizerNode.METRIC_NA...
@Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for image {}", pathPropterty); if (pendingCache.g...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
@Test public void testReadFirstByte() throws Exception { assertThat(input.read(), is(2)); }
@Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } }
ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } }
ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); }
ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); }
ByteBufferInputstream extends InputStream { @Override public int read() throws IOException { if (buffer.hasRemaining()) { return buffer.get() & 0xFF; } else { return -1; } } ByteBufferInputstream(ByteBuffer buffer); @Override int read(); @Override int available(); }
@Test public void testImageSizeHistogramSize() throws Exception { message = new MessageFactory(session).resizeRequest(Paths.get(PATH_NEW), is); for (byte i = 0; i < BUFFER_TEST_DATA_SIZE; i++) { message.getBodyBuffer().writeByte(i); } cut.onMessage(message); assertThat(metrics.getHistograms().get(ResizerNode.METRIC_NAM...
@Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for image {}", pathPropterty); if (pendingCache.g...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
ResizerNode implements MessageHandler, Node { @Override public void onMessage(ClientMessage message) { String pathPropterty = null; resizeRequests.mark(); Context resizeTimeContext = resizeDuration.time(); try { pathPropterty = message.getStringProperty(MessageProperty.path.toString()); LOGGER.debug("Resize request for...
@Test public void testToStringStart() throws Exception { assertThat(cut.toString(), startsWith("ResizerNode {")); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testToStringEnd() throws Exception { assertThat(cut.toString(), endsWith("}")); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } }
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
ResizerNode implements MessageHandler, Node { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(ResizerNode.class.getSimpleName()).append(" {").append(identity.toString()).append("}"); return sb.toString(); } @Inject ResizerNode(ClientSession session, ImageResizer resizer, MetricRe...
@Test public void testAddMessageAboveThreshold() throws Exception { addNumberOfMessages(MESSAGE_THRESHOLD); verify(collector).onDrain(anyListOf(ClientMessage.class)); }
private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : consumers) { drain.onD...
MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con...
MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con...
MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con...
MessageCollector { private void onDrain() { ImmutableList<ClientMessage> immutable; LOGGER.trace("Draining {} collected messsages...", collectedMessages.size()); synchronized (collectedMessages) { immutable = ImmutableList.copyOf(collectedMessages); collectedMessages.clear(); } for (CollectedMessageConsumer drain : con...