/** * Constructor * @param column * @param qualifier * @param timestamp * @param value */ public CellModel(byte[] column, byte[] qualifier, long timestamp, byte[] value) { this.column = CellUtil.makeColumn(column, qualifier); this.timestamp = timestamp; this.value = value; }
/** * Extract columns values from the current record. This method returns * null if any of the columns are not found. * <p> * Override this method if you want to deal with nulls differently. * * @param r The current values. * @return Array of byte values. */ protected byte[][] extractKeyValues(Result r) { byte[][] keyVals = null; ArrayList<byte[]> foundList = new ArrayList<>(); int numCols = columns.length; if (numCols > 0) { for (Cell value: r.listCells()) { byte [] column = CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)); for (int i = 0; i < numCols; i++) { if (Bytes.equals(column, columns[i])) { foundList.add(CellUtil.cloneValue(value)); break; } } } if(foundList.size() == numCols) { keyVals = foundList.toArray(new byte[numCols][]); } } return keyVals; }
/** * Extract columns values from the current record. This method returns * null if any of the columns are not found. * * Override this method if you want to deal with nulls differently. * * @param r * @return array of byte values */ protected byte[][] extractKeyValues(Result r) { byte[][] keyVals = null; ArrayList<byte[]> foundList = new ArrayList<>(); int numCols = columns.length; if (numCols > 0) { for (Cell value: r.listCells()) { byte [] column = CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)); for (int i = 0; i < numCols; i++) { if (Bytes.equals(column, columns[i])) { foundList.add(CellUtil.cloneValue(value)); break; } } } if(foundList.size() == numCols) { keyVals = foundList.toArray(new byte[numCols][]); } } return keyVals; }
CellUtil.cloneRow(value)))); response.header("X-Column", Bytes.toString(Base64.getEncoder().encode( CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value))))); response.header("X-Timestamp", value.getTimestamp()); servlet.getMetrics().incrementSucessfulGetRequests(1);
for (Cell kv : result_.rawCells()) { result.sortedColumns.add(new TColumn( ByteBuffer.wrap(CellUtil.makeColumn(CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv))), new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()))); for (Cell kv : result_.rawCells()) { result.columns.put( ByteBuffer.wrap(CellUtil.makeColumn(CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv))), new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()));
/** * Constructor * @param column * @param qualifier * @param timestamp * @param value */ public CellModel(byte[] column, byte[] qualifier, long timestamp, byte[] value) { this.column = CellUtil.makeColumn(column, qualifier); this.timestamp = timestamp; this.value = value; }
/** * Constructor * @param column * @param qualifier * @param timestamp * @param value */ public CellModel(byte[] column, byte[] qualifier, long timestamp, byte[] value) { this.column = CellUtil.makeColumn(column, qualifier); this.timestamp = timestamp; this.value = value; }
/** * Extract columns values from the current record. This method returns * null if any of the columns are not found. * * Override this method if you want to deal with nulls differently. * * @param r * @return array of byte values */ protected byte[][] extractKeyValues(Result r) { byte[][] keyVals = null; ArrayList<byte[]> foundList = new ArrayList<>(); int numCols = columns.length; if (numCols > 0) { for (Cell value: r.listCells()) { byte [] column = CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)); for (int i = 0; i < numCols; i++) { if (Bytes.equals(column, columns[i])) { foundList.add(CellUtil.cloneValue(value)); break; } } } if(foundList.size() == numCols) { keyVals = foundList.toArray(new byte[numCols][]); } } return keyVals; }
/** * Extract columns values from the current record. This method returns * null if any of the columns are not found. * <p> * Override this method if you want to deal with nulls differently. * * @param r The current values. * @return Array of byte values. */ protected byte[][] extractKeyValues(Result r) { byte[][] keyVals = null; ArrayList<byte[]> foundList = new ArrayList<>(); int numCols = columns.length; if (numCols > 0) { for (Cell value: r.listCells()) { byte [] column = CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)); for (int i = 0; i < numCols; i++) { if (Bytes.equals(column, columns[i])) { foundList.add(CellUtil.cloneValue(value)); break; } } } if(foundList.size() == numCols) { keyVals = foundList.toArray(new byte[numCols][]); } } return keyVals; }
/** * Extract columns values from the current record. This method returns * null if any of the columns are not found. * * Override this method if you want to deal with nulls differently. * * @param r * @return array of byte values */ protected byte[][] extractKeyValues(Result r) { byte[][] keyVals = null; ArrayList<byte[]> foundList = new ArrayList<>(); int numCols = columns.length; if (numCols > 0) { for (Cell value: r.listCells()) { byte [] column = CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)); for (int i = 0; i < numCols; i++) { if (Bytes.equals(column, columns[i])) { foundList.add(CellUtil.cloneValue(value)); break; } } } if(foundList.size() == numCols) { keyVals = foundList.toArray(new byte[numCols][]); } } return keyVals; }
/** * Extract columns values from the current record. This method returns * null if any of the columns are not found. * <p> * Override this method if you want to deal with nulls differently. * * @param r The current values. * @return Array of byte values. */ protected byte[][] extractKeyValues(Result r) { byte[][] keyVals = null; ArrayList<byte[]> foundList = new ArrayList<>(); int numCols = columns.length; if (numCols > 0) { for (Cell value: r.listCells()) { byte [] column = CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)); for (int i = 0; i < numCols; i++) { if (Bytes.equals(column, columns[i])) { foundList.add(CellUtil.cloneValue(value)); break; } } } if(foundList.size() == numCols) { keyVals = foundList.toArray(new byte[numCols][]); } } return keyVals; }
CellUtil.cloneRow(value)))); response.header("X-Column", Bytes.toString(Base64.getEncoder().encode( CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value))))); response.header("X-Timestamp", value.getTimestamp()); servlet.getMetrics().incrementSucessfulGetRequests(1);
for (Cell kv : result_.rawCells()) { result.sortedColumns.add(new TColumn( ByteBuffer.wrap(CellUtil.makeColumn(CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv))), new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()))); for (Cell kv : result_.rawCells()) { result.columns.put( ByteBuffer.wrap(CellUtil.makeColumn(CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv))), new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()));
response.header("X-Column", Base64.encodeBytes( CellUtil.makeColumn(CellUtil.cloneFamily(value), CellUtil.cloneQualifier(value)))); response.header("X-Timestamp", value.getTimestamp()); servlet.getMetrics().incrementSucessfulGetRequests(1);
for (Cell kv : result_.rawCells()) { result.sortedColumns.add(new TColumn( ByteBuffer.wrap(CellUtil.makeColumn(CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv))), new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()))); for (Cell kv : result_.rawCells()) { result.columns.put( ByteBuffer.wrap(CellUtil.makeColumn(CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv))), new TCell(ByteBuffer.wrap(CellUtil.cloneValue(kv)), kv.getTimestamp()));