Writer(long startOffset) { this.writeOffset = startOffset; this.buf = ByteBuffer.allocate(info.getMaxRecordLength()); if (debug) logger.debug(ConcurrentDiskStore.this + " write start @ " + writeOffset); OutputStream out = new OutputStream() { byte[] tmp = new byte[1]; @Override public void write(int b) throws IOException { tmp[0] = (byte) b; write(tmp, 0, 1); } @Override public void write(byte[] bytes, int offset, int length) throws IOException { while (length > 0) { int n = writeChannel.write(ByteBuffer.wrap(bytes, offset, length), writeOffset); offset += n; length -= n; writeOffset += n; } } }; dout = new DataOutputStream(new BufferedOutputStream(out, STREAM_BUFFER_SIZE)); }
/** set record to the codes of specified values, new space allocated to hold the codes */ public GTRecord setValues(Object... values) { setValues(info.colAll, new ByteArray(info.getMaxRecordLength()), values); return this; }
GTRecord record = new GTRecord(info); GTRecord next; ByteBuffer buf = ByteBuffer.allocate(info.getMaxRecordLength());
GTRecord record = new GTRecord(info); GTRecord next; ByteBuffer buf = ByteBuffer.allocate(info.getMaxRecordLength());
Writer(long startOffset) throws IOException { buf = ByteBuffer.allocate(info.getMaxRecordLength()); writeOffset = 0; // TODO does not support append yet memPart.clear();
@Override protected void doSetup(Mapper.Context context) throws IOException { super.doSetup(context); long baseCuboid = Cuboid.getBaseCuboidId(cubeDesc); GTInfo gtInfo = CubeGridTable.newGTInfo(Cuboid.findForMandatory(cubeDesc, baseCuboid), new CubeDimEncMap(cubeDesc, dictionaryMap)); keyValueBuffer = ByteBuffer.allocate(gtInfo.getMaxRecordLength()); keyOffset = cubeSegment.getRowKeyPreambleSize(); }
Writer(long startOffset) { this.writeOffset = startOffset; this.buf = ByteBuffer.allocate(info.getMaxRecordLength()); if (debug) logger.debug(ConcurrentDiskStore.this + " write start @ " + writeOffset); OutputStream out = new OutputStream() { byte[] tmp = new byte[1]; @Override public void write(int b) throws IOException { tmp[0] = (byte) b; write(tmp, 0, 1); } @Override public void write(byte[] bytes, int offset, int length) throws IOException { while (length > 0) { int n = writeChannel.write(ByteBuffer.wrap(bytes, offset, length), writeOffset); offset += n; length -= n; writeOffset += n; } } }; dout = new DataOutputStream(new BufferedOutputStream(out, STREAM_BUFFER_SIZE)); }
/** set record to the codes of specified values, new space allocated to hold the codes */ public GTRecord setValues(Object... values) { setValues(info.colAll, new ByteArray(info.getMaxRecordLength()), values); return this; }
GTRecord record = new GTRecord(info); GTRecord next; ByteBuffer buf = ByteBuffer.allocate(info.getMaxRecordLength());
GTRecord record = new GTRecord(info); GTRecord next; ByteBuffer buf = ByteBuffer.allocate(info.getMaxRecordLength());
Writer(long startOffset) throws IOException { buf = ByteBuffer.allocate(info.getMaxRecordLength()); writeOffset = 0; // TODO does not support append yet memPart.clear();
@Override protected void doSetup(Mapper.Context context) throws IOException { super.doSetup(context); long baseCuboid = Cuboid.getBaseCuboidId(cubeDesc); GTInfo gtInfo = CubeGridTable.newGTInfo(Cuboid.findForMandatory(cubeDesc, baseCuboid), new CubeDimEncMap(cubeDesc, dictionaryMap)); keyValueBuffer = ByteBuffer.allocate(gtInfo.getMaxRecordLength()); keyOffset = cubeSegment.getRowKeyPreambleSize(); }