Java 类org.apache.hadoop.io.file.tfile.TFile.Reader.Location 实例源码

项目:hadoop-on-lustre    文件:TestTFileByteArrays.java   
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  Location loc2 =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock, 2)
          .getBytes());
  Location locLastIn1stBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock - 1).getBytes());
  Location locFirstIn2ndBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-0.20    文件:TestTFileByteArrays.java   
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  Location loc2 =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock, 2)
          .getBytes());
  Location locLastIn1stBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock - 1).getBytes());
  Location locFirstIn2ndBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hortonworks-extension    文件:TestTFileByteArrays.java   
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  Location loc2 =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock, 2)
          .getBytes());
  Location locLastIn1stBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock - 1).getBytes());
  Location locFirstIn2ndBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hortonworks-extension    文件:TestTFileByteArrays.java   
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  Location loc2 =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock, 2)
          .getBytes());
  Location locLastIn1stBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock - 1).getBytes());
  Location locFirstIn2ndBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-gpu    文件:TestTFileByteArrays.java   
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  Location loc2 =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock, 2)
          .getBytes());
  Location locLastIn1stBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock - 1).getBytes());
  Location locFirstIn2ndBlock =
      locate(scanner, composeSortedKey(KEY, 3 * records1stBlock,
          records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-oss    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:aliyun-oss-hadoop-fs    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:big-c    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-EAR    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-plus    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hops    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-TCP    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hardfs    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-on-lustre2    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:RDFS    文件:TestTFileByteArrays.java   
@Test
public void testLocate() throws IOException {
  if (skip)
    return;
  writeRecords(3 * records1stBlock);
  Reader reader = new Reader(fs.open(path), fs.getFileStatus(path).getLen(), conf);
  Scanner scanner = reader.createScanner();
  locate(scanner, composeSortedKey(KEY, 2).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock - 1).getBytes());
  locate(scanner, composeSortedKey(KEY, records1stBlock).getBytes());
  Location locX = locate(scanner, "keyX".getBytes());
  Assert.assertEquals(scanner.endLocation, locX);
  scanner.close();
  reader.close();
}
项目:hadoop-oss    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:aliyun-oss-hadoop-fs    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:big-c    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-EAR    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-plus    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hops    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-TCP    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-on-lustre    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hardfs    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-on-lustre2    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:RDFS    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-0.20    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hortonworks-extension    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hortonworks-extension    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}
项目:hadoop-gpu    文件:TestTFileByteArrays.java   
Location locate(Scanner scanner, byte[] key) throws IOException {
  if (scanner.seekTo(key) == true) {
    return scanner.currentLocation;
  }
  return scanner.endLocation;
}