return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e);
@Override public List<TCell> append(TAppend tappend) throws IOError, TException { if (tappend.getRow().length == 0 || tappend.getTable().length == 0) { throw new TException("Must supply a table and a row key; can't append"); } Table table = null; try { table = getTable(tappend.getTable()); Append append = ThriftUtilities.appendFromThrift(tappend); Result result = table.append(append); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw getIOError(e); } finally{ closeTable(table); } }
/** * Note: this public interface is slightly different from public Java APIs in regard to * handling of the qualifier. Here we differ from the public Java API in that null != byte[0]. * Rather, we respect qual == null as a request for the entire column family. If you want to * access the entire column family, use * {@link #getVer(ByteBuffer, ByteBuffer, ByteBuffer, int, Map)} with a {@code column} value * that lacks a {@code ':'}. */ public List<TCell> getVer(ByteBuffer tableName, ByteBuffer row, byte[] family, byte[] qualifier, int numVersions, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { Table table = null; try { table = getTable(tableName); Get get = new Get(getBytes(row)); addAttributes(get, attributes); if (null == qualifier) { get.addFamily(family); } else { get.addColumn(family, qualifier); } get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw getIOError(e); } finally{ closeTable(table); } }
get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e);
@Override public List<TCell> getRowOrBefore(ByteBuffer tableName, ByteBuffer row, ByteBuffer family) throws IOError { try { HTable table = getTable(getBytes(tableName)); Result result = table.getRowOrBefore(getBytes(row), getBytes(family)); return ThriftUtilities.cellFromHBase(result.raw()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw new IOError(e.getMessage()); } }
public List<TCell> getVer(ByteBuffer tableName, ByteBuffer row, byte[] family, byte[] qualifier, int numVersions, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { try { HTable table = getTable(tableName); Get get = new Get(getBytes(row)); addAttributes(get, attributes); get.addColumn(family, qualifier); get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.raw()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw new IOError(e.getMessage()); } }
protected List<TCell> get(ByteBuffer tableName, ByteBuffer row, byte[] family, byte[] qualifier, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { try { HTable table = getTable(tableName); Get get = new Get(getBytes(row)); addAttributes(get, attributes); if (qualifier == null || qualifier.length == 0) { get.addFamily(family); } else { get.addColumn(family, qualifier); } Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.raw()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw new IOError(e.getMessage()); } }
protected List<TCell> getVerTs(ByteBuffer tableName, ByteBuffer row, byte [] family, byte [] qualifier, long timestamp, int numVersions, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { try { HTable table = getTable(tableName); Get get = new Get(getBytes(row)); addAttributes(get, attributes); get.addColumn(family, qualifier); get.setTimeRange(Long.MIN_VALUE, timestamp); get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.raw()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw new IOError(e.getMessage()); } }
return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e);
return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e);
get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e);
/** * Note: this public interface is slightly different from public Java APIs in regard to * handling of the qualifier. Here we differ from the public Java API in that null != byte[0]. * Rather, we respect qual == null as a request for the entire column family. If you want to * access the entire column family, use * {@link #getVer(ByteBuffer, ByteBuffer, ByteBuffer, int, Map)} with a {@code column} value * that lacks a {@code ':'}. */ public List<TCell> getVer(ByteBuffer tableName, ByteBuffer row, byte[] family, byte[] qualifier, int numVersions, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { Table table = null; try { table = getTable(tableName); Get get = new Get(getBytes(row)); addAttributes(get, attributes); if (null == qualifier) { get.addFamily(family); } else { get.addColumn(family, qualifier); } get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw getIOError(e); } finally{ closeTable(table); } }
/** * Note: this public interface is slightly different from public Java APIs in regard to * handling of the qualifier. Here we differ from the public Java API in that null != byte[0]. * Rather, we respect qual == null as a request for the entire column family. If you want to * access the entire column family, use * {@link #getVer(ByteBuffer, ByteBuffer, ByteBuffer, int, Map)} with a {@code column} value * that lacks a {@code ':'}. */ public List<TCell> getVer(ByteBuffer tableName, ByteBuffer row, byte[] family, byte[] qualifier, int numVersions, Map<ByteBuffer, ByteBuffer> attributes) throws IOError { Table table = null; try { table = getTable(tableName); Get get = new Get(getBytes(row)); addAttributes(get, attributes); if (null == qualifier) { get.addFamily(family); } else { get.addColumn(family, qualifier); } get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw getIOError(e); } finally{ closeTable(table); } }
@Override public List<TCell> append(TAppend tappend) throws IOError, TException { if (tappend.getRow().length == 0 || tappend.getTable().length == 0) { throw new TException("Must supply a table and a row key; can't append"); } Table table = null; try { table = getTable(tappend.getTable()); Append append = ThriftUtilities.appendFromThrift(tappend); Result result = table.append(append); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw getIOError(e); } finally{ closeTable(table); } }
@Override public List<TCell> append(TAppend tappend) throws IOError, TException { if (tappend.getRow().length == 0 || tappend.getTable().length == 0) { throw new TException("Must supply a table and a row key; can't append"); } Table table = null; try { table = getTable(tappend.getTable()); Append append = ThriftUtilities.appendFromThrift(tappend); Result result = table.append(append); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw getIOError(e); } finally{ closeTable(table); } }
get.setMaxVersions(numVersions); Result result = table.get(get); return ThriftUtilities.cellFromHBase(result.rawCells()); } catch (IOException e) { LOG.warn(e.getMessage(), e);