230231232233234235236237238239240
"nor Syncable.hflush()."); } } syncMethod.invoke(out, new Object[]{}); FSDataInputStream in = fs.open(p); assertTrue(in.available() > 0); byte [] buffer = new byte [1024]; int read = in.read(buffer); assertEquals(bytes.length, read); out.close(); in.close();
232233234235236237238239240241242
"nor Syncable.hflush()."); } } syncMethod.invoke(out, new Object[]{}); FSDataInputStream in = fs.open(p); assertTrue(in.available() > 0); byte [] buffer = new byte [1024]; int read = in.read(buffer); assertEquals(tableName.getName().length, read); out.close(); in.close();
237238239240241242243244245246247
145146147148149150151152153154155
int v; v = s2.read(); assertEquals(v, 32); assertEquals(s2.available(), data.length); byte[] buf = new byte[bufsz]; s2.read(buf, 0, buf.length); for (int i = 0; i < data.length; i++) assertEquals(data[i], buf[i]);
152153154155156157158159160161162
byte[] buf = new byte[bufsz]; s2.read(buf, 0, buf.length); for (int i = 0; i < data.length; i++) assertEquals(data[i], buf[i]); assertEquals(s2.available(), 0); s2.close(); kosmosFileSystem.delete(file1); assertFalse(kosmosFileSystem.exists(file1));
183184185186187188189190191192193
Path p = new Path(dir, getName() + ".fsdos"); FSDataOutputStream out = fs.create(p); out.write(bytes); out.sync(); FSDataInputStream in = fs.open(p); assertTrue(in.available() > 0); byte [] buffer = new byte [1024]; int read = in.read(buffer); assertEquals(bytes.length, read); out.close(); in.close();
239240241242243244245246247248249
return f.getAbsolutePath(); } private String readFully(Path file) throws IOException { FSDataInputStream in = fs.open(file); byte[] b = new byte[in.available()]; in.readFully(b); in.close(); return new String(b); }
236237238239240241242243244245246
427428429430431432433434435436437
LOG.debug("Done with bucketing. Split time!"); long startTime = System.currentTimeMillis(); // open the split file and modify it as splits finish FSDataInputStream tmpIn = fs.open(splitFile); byte[] rawData = new byte[tmpIn.available()]; tmpIn.readFully(rawData); tmpIn.close(); FSDataOutputStream splitOut = fs.create(splitFile); splitOut.write(rawData);