Skip to content

Commit

Permalink
another comment corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyangk committed May 19, 2015
1 parent e0257a6 commit 0534513
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public final class SurfFSOutputStream extends OutputStream {
private static final Logger LOG = Logger.getLogger(SurfFSOutputStream.class.getName());
private static final int PACKET_SIZE = 4194304; // 4MB
private static final int PACKET_SIZE = 4 * 1024 * 1024; // 4MB
private static final int MAX_PACKETS = 80;
private static final int COMPLETE_FILE_RETRY_NUM = 5;
private static final int COMPLETE_FILE_RETRY_INTERVAL = 400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final class SurfFSWriteITCase {
private static final String SURF_ADDRESS = "localhost:18000";

private static final short REPLICATION = 3;
private static final int BLOCK_SIZE = 1024; // Need to be a multiple of 512 (Hadoop Checksum Policy)
private static final int BLOCK_SIZE = 1024 * 1024; // 1MB, Need to be a multiple of 512 (Hadoop Checksum Policy)
private static final int BUFFER_SIZE = 4096;

private static final SurfLauncher surfLauncher = new SurfLauncher();
Expand All @@ -66,22 +66,22 @@ public static void setUpClass() throws IOException, InjectionException {
surfFs = new SurfFS();
surfFs.initialize(URI.create(SURF + "://" + SURF_ADDRESS), conf);

// FILE_SIZE < PACKET_SIZE
// FILE_SIZE(8B) < BLOCK_SIZE(1MB) < PACKET_SIZE(4MB)
final FSDataOutputStream stream1 = surfFs.create(new Path(SMALL), true, BUFFER_SIZE, REPLICATION, BLOCK_SIZE);
for (int i = 0; i < SMALL_SIZE; i++) {
stream1.write(b);
}
stream1.close();

// PACKET_SIZE > FILE_SIZE
// FILE_SIZE(1MB) == BLOCK_SIZE(1MB) < PACKET_SIZE(4MB)
final FSDataOutputStream stream2 = surfFs.create(new Path(ONE_MB), true, BUFFER_SIZE, REPLICATION, BLOCK_SIZE);
for (int i = 0; i < ONE_MB_SIZE; i++) {
stream2.write(b);
}
stream2.close();

// FILE_SIZE == PACKET_SIZE < BLOCK_SIZE
final FSDataOutputStream stream3 = surfFs.create(new Path(PACKET));
// FILE_SIZE(4MB) == PACKET_SIZE(4MB) < BLOCK_SIZE(64MB)
final FSDataOutputStream stream3 = surfFs.create(new Path(PACKET)); // use the default BLOCK_SIZE (64MB)
for (int i = 0; i < PACKET_SIZE; i++) {
stream3.write(b);
}
Expand Down

0 comments on commit 0534513

Please sign in to comment.