private void addContainer(int col, ColumnValueContainer c) { if (containers == null) { containers = new ColumnValueContainer[info.getColumnCount()]; } containers[col] = c; }
public int getColumnCount() { return digest.getColumnCount(); }
public Slice(TableRecordInfoDigest digest, short shard, long timestamp, ColumnValueContainer[] containers) { this.info = digest; this.nColumns = digest.getColumnCount(); this.shard = shard; this.timestamp = timestamp; this.nRecords = containers[0].getSize(); this.containers = containers; assert nColumns == containers.length; for (int i = 0; i < nColumns; i++) { assert nRecords == containers[i].getSize(); } }
public SliceBuilder(TableRecordInfo info, short shard) { this.info = info; this.nColumns = info.getDigest().getColumnCount(); this.nRecordsCap = Math.max(1, info.getDescriptor().getSliceSize()); this.shard = shard; this.sliceTimestamp = Long.MIN_VALUE; this.nRecords = 0; this.containers = null; doneSlice(); // init containers }
public static CoprocessorProjector makeForEndpoint(final TableRecordInfo tableInfo, final Collection<TblColRef> groupby) { byte[] mask = new byte[tableInfo.getDigest().getByteFormLen()]; int maskIdx = 0; for (int i = 0; i < tableInfo.getDigest().getColumnCount(); ++i) { TblColRef tblColRef = tableInfo.getColumns().get(i); int length = tableInfo.getDigest().length(i); byte bits = groupby.contains(tblColRef) ? (byte) 0xff : 0x00; for (int j = 0; j < length; ++j) { mask[maskIdx++] = bits; } } return new CoprocessorProjector(mask); }
public int getColumnCount() { return digest.getColumnCount(); }
@Test public void testSerialize() { byte[] x = TableRecordInfoDigest.serialize(this.tableRecordInfo.getDigest()); TableRecordInfoDigest d = TableRecordInfoDigest.deserialize(x); assertEquals(d.getColumnCount(), 25); }
@Override public boolean hasNext() { while (buffer.size() < incompleteDigest.getColumnCount() && iiRowIterator.hasNext()) { buffer.add(iiRowIterator.next()); } return buffer.size() == incompleteDigest.getColumnCount(); }
@Override public Slice next() { while (buffer.size() < incompleteDigest.getColumnCount() && iiRowIterator.hasNext()) { buffer.add(iiRowIterator.next()); } Preconditions.checkArgument(buffer.size() == incompleteDigest.getColumnCount(), "not enough IIRows!"); Slice ret = IIRowDecoderWithState.this.getSuperIterator().next(); buffer.clear(); return ret; }
public Slice(TableRecordInfoDigest digest, short shard, long timestamp, ColumnValueContainer[] containers) { this.info = digest; this.nColumns = digest.getColumnCount(); this.shard = shard; this.timestamp = timestamp; this.nRecords = containers[0].getSize(); this.containers = containers; assert nColumns == containers.length; for (int i = 0; i < nColumns; i++) { assert nRecords == containers[i].getSize(); } }
public IncrementalSliceMaker(TableRecordInfo info, short shard) { this.info = info; this.nColumns = info.getDigest().getColumnCount(); this.nRecordsCap = Math.max(1, info.getDescriptor().getSliceSize()); this.shard = shard; this.sliceTimestamp = Long.MIN_VALUE; this.nRecords = 0; this.containers = null; doneSlice(); // init containers }
@Override public Slice next() { int columns = 0; ColumnValueContainer[] valueContainers = new ColumnValueContainer[incompleteDigest.getColumnCount()]; Dictionary<?>[] localDictionaries = new Dictionary<?>[incompleteDigest.getColumnCount()]; boolean firstTime = true; short curShard = 0; long lastTimestamp = 0; while (feedingIterator.hasNext() && columns < incompleteDigest.getColumnCount()) { final IIRow row = feedingIterator.next(); final ImmutableBytesWritable key = row.getKey(); firstTime = false; Preconditions.checkArgument(columns == incompleteDigest.getColumnCount(), "column count is " + columns + " should be equals to incompleteDigest.getColumnCount() " + incompleteDigest.getColumnCount());