/** * @param row row key; we make a copy of what we are passed to keep local. * @param ts timestamp */ public Put(ByteBuffer row, long ts) { if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } checkRow(row); this.row = new byte[row.remaining()]; row.get(this.row); this.ts = ts; }
/** * We make a copy of the passed in row key to keep local. * @param rowArray * @param rowOffset * @param rowLength * @param ts */ public Put(byte [] rowArray, int rowOffset, int rowLength, long ts) { checkRow(rowArray, rowOffset, rowLength); this.row = Bytes.copy(rowArray, rowOffset, rowLength); this.ts = ts; if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } }
/** * Create a Put operation for an immutable row key, using a given timestamp. * * @param row row key * @param ts timestamp * @param rowIsImmutable whether the input row is immutable. * Set to true if the caller can guarantee that * the row will not be changed for the Put duration. */ public Put(byte[] row, long ts, boolean rowIsImmutable) { // Check and set timestamp if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } this.ts = ts; // Deal with row according to rowIsImmutable checkRow(row); if (rowIsImmutable) { // Row is immutable this.row = row; // Do not make a local copy, but point to the provided byte array directly } else { // Row is not immutable this.row = Bytes.copy(row, 0, row.length); // Make a local copy } }
/** * @param row row key; we make a copy of what we are passed to keep local. * @param ts timestamp */ public Put(ByteBuffer row, long ts) { if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } checkRow(row); this.row = new byte[row.remaining()]; row.get(this.row); this.ts = ts; }
/** * We make a copy of the passed in row key to keep local. * @param rowArray * @param rowOffset * @param rowLength * @param ts */ public Put(byte [] rowArray, int rowOffset, int rowLength, long ts) { checkRow(rowArray, rowOffset, rowLength); this.row = Bytes.copy(rowArray, rowOffset, rowLength); this.ts = ts; if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } }
/** * Create a Put operation for an immutable row key, using a given timestamp. * * @param row row key * @param ts timestamp * @param rowIsImmutable whether the input row is immutable. * Set to true if the caller can guarantee that * the row will not be changed for the Put duration. */ public Put(byte[] row, long ts, boolean rowIsImmutable) { // Check and set timestamp if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } this.ts = ts; // Deal with row according to rowIsImmutable checkRow(row); if (rowIsImmutable) { // Row is immutable this.row = row; // Do not make a local copy, but point to the provided byte array directly } else { // Row is not immutable this.row = Bytes.copy(row, 0, row.length); // Make a local copy } }
/** * @param row row key; we make a copy of what we are passed to keep local. * @param ts timestamp */ public Put(ByteBuffer row, long ts) { if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } checkRow(row); this.row = new byte[row.remaining()]; row.get(this.row); this.ts = ts; }
/** * @param row row key; we make a copy of what we are passed to keep local. * @param ts timestamp */ public Put(ByteBuffer row, long ts) { if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } checkRow(row); this.row = new byte[row.remaining()]; row.get(this.row); this.ts = ts; }
/** * We make a copy of the passed in row key to keep local. * @param rowArray * @param rowOffset * @param rowLength * @param ts */ public Put(byte [] rowArray, int rowOffset, int rowLength, long ts) { checkRow(rowArray, rowOffset, rowLength); this.row = Bytes.copy(rowArray, rowOffset, rowLength); this.ts = ts; if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } }
/** * We make a copy of the passed in row key to keep local. * @param rowArray * @param rowOffset * @param rowLength * @param ts */ public Put(byte [] rowArray, int rowOffset, int rowLength, long ts) { checkRow(rowArray, rowOffset, rowLength); this.row = Bytes.copy(rowArray, rowOffset, rowLength); this.ts = ts; if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } }
/** * Create a Put operation for an immutable row key, using a given timestamp. * * @param row row key * @param ts timestamp * @param rowIsImmutable whether the input row is immutable. * Set to true if the caller can guarantee that * the row will not be changed for the Put duration. */ public Put(byte[] row, long ts, boolean rowIsImmutable) { // Check and set timestamp if (ts < 0) { throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts); } this.ts = ts; // Deal with row according to rowIsImmutable checkRow(row); if (rowIsImmutable) { // Row is immutable this.row = row; // Do not make a local copy, but point to the provided byte array directly } else { // Row is not immutable this.row = Bytes.copy(row, 0, row.length); // Make a local copy } }