@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof FileInputSplit && super.equals(obj)) { FileInputSplit other = (FileInputSplit) obj; return this.start == other.start && this.length == other.length && (this.file == null ? other.file == null : (other.file != null && this.file.equals(other.file))); } else { return false; } }
@Override protected boolean matchesSafely(Bucket<String, String> bucket) { return bucket.getBucketId().equals(bucketId) && bucket.getBucketPath().equals(new Path(testTmpPath, bucketId)) && bucket.getInProgressPart() == null && bucket.getPendingPartsForCurrentCheckpoint().isEmpty() && bucket.getPendingPartsPerCheckpoint().size() == 1; }
/** * 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.parallelism; 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 - getInfoSize()) + 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()); } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FileStateHandle)) { return false; } FileStateHandle that = (FileStateHandle) o; return filePath.equals(that.filePath); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FileStateHandle)) { return false; } FileStateHandle that = (FileStateHandle) o; return filePath.equals(that.filePath); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FileStateHandle)) { return false; } FileStateHandle that = (FileStateHandle) o; return filePath.equals(that.filePath); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof FileStateHandle)) { return false; } FileStateHandle that = (FileStateHandle) o; return filePath.equals(that.filePath); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DirectoryStateHandle that = (DirectoryStateHandle) o; return directory.equals(that.directory); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DirectoryStateHandle that = (DirectoryStateHandle) o; return directory.equals(that.directory); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SnapshotDirectory that = (SnapshotDirectory) o; return directory.equals(that.directory); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SnapshotDirectory that = (SnapshotDirectory) o; return directory.equals(that.directory); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SnapshotDirectory that = (SnapshotDirectory) o; return directory.equals(that.directory); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DirectoryStateHandle that = (DirectoryStateHandle) o; return directory.equals(that.directory); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof FileInputSplit && super.equals(obj)) { FileInputSplit other = (FileInputSplit) obj; return this.start == other.start && this.length == other.length && (this.file == null ? other.file == null : (other.file != null && this.file.equals(other.file))); } else { return false; } }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof FileInputSplit && super.equals(obj)) { FileInputSplit other = (FileInputSplit) obj; return this.start == other.start && this.length == other.length && (this.file == null ? other.file == null : (other.file != null && this.file.equals(other.file))); } else { return false; } }