Java Code Examples for org.apache.hadoop.io.file.tfile.TFile.Writer#prepareMetaBlock()

The following examples show how to use org.apache.hadoop.io.file.tfile.TFile.Writer#prepareMetaBlock() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestTFile.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private void writeNumMetablocks(Writer writer, String compression, int n)
    throws IOException {
  for (int i = 0; i < n; i++) {
    DataOutputStream dout =
        writer.prepareMetaBlock("TfileMeta" + i, compression);
    byte[] b = ("something to test" + i).getBytes();
    dout.write(b);
    dout.close();
  }
}
 
Example 2
Source File: TestTFile.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private void someTestingWithMetaBlock(Writer writer, String compression)
    throws IOException {
  DataOutputStream dout = null;
  writeNumMetablocks(writer, compression, 10);
  try {
    dout = writer.prepareMetaBlock("TfileMeta1", compression);
    assertTrue(false);
  }
  catch (MetaBlockAlreadyExists me) {
    // avoid this exception
  }
  dout = writer.prepareMetaBlock("TFileMeta100", compression);
  dout.close();
}
 
Example 3
Source File: TestTFile.java    From big-c with Apache License 2.0 5 votes vote down vote up
private void writeNumMetablocks(Writer writer, String compression, int n)
    throws IOException {
  for (int i = 0; i < n; i++) {
    DataOutputStream dout =
        writer.prepareMetaBlock("TfileMeta" + i, compression);
    byte[] b = ("something to test" + i).getBytes();
    dout.write(b);
    dout.close();
  }
}
 
Example 4
Source File: TestTFile.java    From big-c with Apache License 2.0 5 votes vote down vote up
private void someTestingWithMetaBlock(Writer writer, String compression)
    throws IOException {
  DataOutputStream dout = null;
  writeNumMetablocks(writer, compression, 10);
  try {
    dout = writer.prepareMetaBlock("TfileMeta1", compression);
    assertTrue(false);
  }
  catch (MetaBlockAlreadyExists me) {
    // avoid this exception
  }
  dout = writer.prepareMetaBlock("TFileMeta100", compression);
  dout.close();
}
 
Example 5
Source File: TestTFile.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private void writeNumMetablocks(Writer writer, String compression, int n)
    throws IOException {
  for (int i = 0; i < n; i++) {
    DataOutputStream dout =
        writer.prepareMetaBlock("TfileMeta" + i, compression);
    byte[] b = ("something to test" + i).getBytes();
    dout.write(b);
    dout.close();
  }
}
 
Example 6
Source File: TestTFile.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private void someTestingWithMetaBlock(Writer writer, String compression)
    throws IOException {
  DataOutputStream dout = null;
  writeNumMetablocks(writer, compression, 10);
  try {
    dout = writer.prepareMetaBlock("TfileMeta1", compression);
    assertTrue(false);
  }
  catch (MetaBlockAlreadyExists me) {
    // avoid this exception
  }
  dout = writer.prepareMetaBlock("TFileMeta100", compression);
  dout.close();
}
 
Example 7
Source File: TestTFile.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
private void writeNumMetablocks(Writer writer, String compression, int n)
    throws IOException {
  for (int i = 0; i < n; i++) {
    DataOutputStream dout =
        writer.prepareMetaBlock("TfileMeta" + i, compression);
    byte[] b = ("something to test" + i).getBytes();
    dout.write(b);
    dout.close();
  }
}
 
Example 8
Source File: TestTFile.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
private void someTestingWithMetaBlock(Writer writer, String compression)
    throws IOException {
  DataOutputStream dout = null;
  writeNumMetablocks(writer, compression, 10);
  try {
    dout = writer.prepareMetaBlock("TfileMeta1", compression);
    assertTrue(false);
  }
  catch (MetaBlockAlreadyExists me) {
    // avoid this exception
  }
  dout = writer.prepareMetaBlock("TFileMeta100", compression);
  dout.close();
}