org.apache.flink.core.fs.Path.equals()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中org.apache.flink.core.fs.Path.equals()方法的一些代码示例,展示了Path.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.equals()方法的具体详情如下:
包路径:org.apache.flink.core.fs.Path
类名称:Path
方法名:equals

Path.equals介绍

暂无

代码示例

代码示例来源:origin: apache/flink

@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;
  }
}

代码示例来源:origin: apache/flink

@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;
}

代码示例来源:origin: apache/flink

/**
 * 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());
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

@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);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

@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);
}

代码示例来源:origin: org.apache.flink/flink-runtime

@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);
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

@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);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

@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);
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

@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);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

@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);
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

@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);
}

代码示例来源:origin: org.apache.flink/flink-runtime

@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);
}

代码示例来源:origin: org.apache.flink/flink-runtime

@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);
}

代码示例来源:origin: com.alibaba.blink/flink-core

@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;
  }
}

代码示例来源:origin: org.apache.flink/flink-core

@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;
  }
}

相关文章