public void closeTable() { tableName = null; store = null; Util.closeQuietly(table); table = null; }
/** * Construct a new {@link HandlerProxy} * * @return {@link HandlerProxy} */ public HandlerProxy createHandlerProxy() { return new HandlerProxy(storeFactory); } }
/** * Serialize this {@link Row} instance to a byte array. * * @return Serialized row */ public byte[] serialize() { return Util.serializeAvroObject(row, writer); }
public static byte[] updateSerializedSchema(byte[] row) { byte version = row[0]; if (isMostRecentVersion(version)) { return row; } // Bring the row up to most recent version return Row.deserialize(row).serialize(); }
/** * Deserialize the provided serialized row buffer to a new {@link Row} instance * * @param serializedRow byte buffer containing serialized Row * @return new Row instance from serializedRow */ public static Row deserialize(byte[] serializedRow) { checkNotNull(serializedRow); checkArgument(serializedRow.length > 0); SchemaVersionUtils.processSchemaVersion(serializedRow[0], RowSchemaInfo.VER_CURRENT); return new Row(Util.deserializeAvroObject(serializedRow, reader)); }
public byte[] getRow(byte[] uuid) { checkTableOpen(); checkNotNull(uuid, "Get row cannot have a null UUID."); return table.getRow(Util.bytesToUUID(uuid)).serialize(); }
@Override public QueryKey next() { return new QueryKey(indices.next(), queryTypes.next(), rows.next().getRecords()); } }
public void deleteRow(byte[] rowBytes) { checkTableOpen(); Row row = Row.deserialize(rowBytes); table.deleteRow(row); }
public static QueryKey deserialize(byte[] serializedIndexKey) { checkNotNull(serializedIndexKey); return new QueryKey(Util.deserializeAvroObject(serializedIndexKey, reader)); }
@Test public void testDefaultTablespaceIsUsed() { StoreFactory factory = createFactory(); Store returnedStore = factory.createStore(tableName); assertEquals(returnedStore, this.store); }
@Override public byte[] encode() { if( uuid != null ) { return VarEncoder.appendByteArraysWithPrefix(PREFIX, VarEncoder.encodeULong(tableId), Util.UUIDToBytes(uuid)); } return VarEncoder.appendByteArraysWithPrefix(PREFIX, VarEncoder.encodeULong(tableId)); }
/** * Delete all rows in the table, and reset the auto increment value. */ public void truncateTable() { checkTableOpen(); deleteAllRows(); store.truncateAutoInc(tableName); }
public void startTableScan() { checkTableOpen(); if (currentScanner != null) { endScan(); } currentScanner = table.tableScan(); }
/** * Set the auto increment value of the table to the max of value and the * current value. * * @param value */ public void setAutoIncrement(long value) { checkTableOpen(); store.setAutoInc(tableName, value); }
public void endScan() { if (currentScanner != null) { Util.closeQuietly(currentScanner); currentScanner = null; } }
/** * Serialize the index schema out to a byte array * * @return Serialized form of the index schema */ public byte[] serialize() { return Util.serializeAvroObject(avroIndexSchema, writer); }
@Override public void close() { Util.closeQuietly(hTable); }
/** * Serialize the column schema out to a byte array * * @return Serialized form of the column schema */ public byte[] serialize() { return Util.serializeAvroObject(avroColumnSchema, writer); }
/** * Serialize the table schema out to a byte array * * @return Serialized form of the table schema */ public byte[] serialize() { return Util.serializeAvroObject(avroTableSchema, writer); }
public byte[] serialize() { return Util.serializeAvroObject(avroQueryKey, writer); }