/** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (this.jobID == null) { return false; } if (this.clientPath == null) { return false; } if (obj instanceof LibraryTranslationKey) { final LibraryTranslationKey key = (LibraryTranslationKey) obj; if (this.jobID.equals(key.getJobID()) && this.clientPath.equals(key.getClientPath())) { return true; } } return false; }
/** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (this.jobID == null) { return false; } if (this.clientPath == null) { return false; } if (obj instanceof LibraryTranslationKey) { final LibraryTranslationKey key = (LibraryTranslationKey) obj; if (this.jobID.equals(key.getJobID()) && this.clientPath.equals(key.getClientPath())) { return true; } } return false; }
/** * Checks if the expected input splits were created */ @Test public void checkInputSplits() throws IOException { FileInputSplit[] inputSplits = this.createInputFormat().createInputSplits(0); Arrays.sort(inputSplits, new InputSplitSorter()); int splitIndex = 0; for (int fileIndex = 0; fileIndex < this.degreeOfParallelism; fileIndex++) { List<FileInputSplit> sameFileSplits = new ArrayList<FileInputSplit>(); Path lastPath = inputSplits[splitIndex].getPath(); for (; splitIndex < inputSplits.length; splitIndex++) { if (!inputSplits[splitIndex].getPath().equals(lastPath)) { break; } sameFileSplits.add(inputSplits[splitIndex]); } Assert.assertEquals(this.getExpectedBlockCount(fileIndex), sameFileSplits.size()); long lastBlockLength = this.rawDataSizes[fileIndex] % (this.blockSize - this.info.getInfoSize()) + this.info.getInfoSize(); for (int index = 0; index < sameFileSplits.size(); index++) { Assert.assertEquals(this.blockSize * index, sameFileSplits.get(index).getStart()); if (index < sameFileSplits.size() - 1) { Assert.assertEquals(this.blockSize, sameFileSplits.get(index).getLength()); } } Assert.assertEquals(lastBlockLength, sameFileSplits.get(sameFileSplits.size() - 1).getLength()); } }