/** * Deletes an entire row. * * <p>Note HBase does not represent row deletions with individual (cross-family) * tombstones. Instead, this method issues a family delete for each locality group * individually.</p> * * @param entityId Entity ID of the row to delete. * @throws IOException on I/O error. */ @Override public void deleteRow(EntityId entityId) throws IOException { deleteRow(entityId, HConstants.LATEST_TIMESTAMP); }
/** {@inheritDoc} */ @Override protected void map(EntityId key, FijiRowData values, Context context) throws IOException { map(values, context); }
/** {@inheritDoc} */ @Override public <T> void put(EntityId entityId, String family, String qualifier, T value) throws IOException { put(entityId, family, qualifier, HConstants.LATEST_TIMESTAMP, value); }
/** {@inheritDoc} */ @Override public List<InputSplit> getSplits(JobContext context) throws IOException { List<InputSplit> splits = super.getSplits(context); // TableInputFormat opens an HTable within its setConf() method, since it is // required during getSplits(). HTableInterface openedTable = getHTable(); assert null != openedTable; // After getSplits(), it is no longer necessary, so let's close it. openedTable.close(); setHTable(null); return splits; } }
/** {@inheritDoc} */ @Override protected void setup(Context context) throws IOException { super.setup(context); Preconditions.checkState(null == mContext); setConf(context.getConfiguration()); mContext = FijiTableContextFactory.create(context); mPivoter = FijiPivoters.create(getConf()); mPivoter.setup(mContext); }
/** {@inheritDoc} */ @Override public void close() throws IOException { mTableContext.close(); super.close(); } }
@Override public void setConf(Configuration conf) { super.setConf(conf); }
/** {@inheritDoc} */ @Override public void flush() throws IOException { mTableContext.flush(); super.flush(); }
/** {@inheritDoc} */ @Override public void deleteColumn(EntityId entityId, String family, String qualifier) throws IOException { deleteColumn(entityId, family, qualifier, HConstants.LATEST_TIMESTAMP); }
/** * Creates a new context that can write cells directly to a Fiji table. * * @param hadoopContext is the Hadoop {@link TaskInputOutputContext} that will be used to perform * the writes. * @return a new context that can write cells directly to a Fiji table. * @throws IOException if there is an I/O error. */ public static DirectFijiTableWriterContext create(TaskInputOutputContext<?, ?, ?, ?> hadoopContext) throws IOException { return new DirectFijiTableWriterContext(hadoopContext); }
/** {@inheritDoc} */ @Override public void deleteCell(EntityId entityId, String family, String qualifier) throws IOException { deleteCell(entityId, family, qualifier, HConstants.LATEST_TIMESTAMP); }
/** * Creates a new context that can write cells to an HFile that can be loaded into an HBase table. * * @param hadoopContext is the Hadoop {@link TaskInputOutputContext} that will be used to perform * the writes. * @return a new context that can write cells to an HFile that can be loaded into an HBase table. * @throws IOException if there is an I/O error. */ public static HFileWriterContext create(TaskInputOutputContext<?, ?, ?, ?> hadoopContext) throws IOException { return new HFileWriterContext(hadoopContext); }
/** * Deletes all versions of all cells in a family. * * <p>When the deleted fiji family is the only one in the enclosing locality group, a * single (hbase) family delete is issued.</p> * * <p>However this won't work when there are other families within the locality group: * the delete would affect them too. In this case, this method instead issues a * sequence of column deletes in way depending on the family type.</p> * * <p>Group-type families are handled by issuing a column delete for each of their * columns as declared by their fixed layout.</p> * * <p>Map-type families are handled by enumerating the existing cells of the family and * issuing columns deletes. This strategy is susceptible to races with writers: a new * put occurring after MR job execution but before bulk load will not be deleted.</p> * * <P>Again, notice this limitation does not apply if the map-type family is the only * one in its locality group. As stated above, in that case a single family delete is * issued and no leaks are possible.</p> * * @param entityId Entity ID of the row to delete data from. * @param family Column family. * @throws IOException on I/O error. */ @Override public void deleteFamily(EntityId entityId, String family) throws IOException { deleteFamily(entityId, family, HConstants.LATEST_TIMESTAMP); }
/** * {@inheritDoc} * Sets up job resources. * User overridden setup methods must contain super.setup(). super.setup() should be the first * line of overridden setup methods so that so that KeyValueStores and FijiTableContext will be * initialized and ready for use by the rest of setup(). */ @Override protected void setup(Context hadoopContext) throws IOException, InterruptedException { Preconditions.checkState(mTableContext == null); super.setup(hadoopContext); mTableContext = FijiTableContextFactory.create(hadoopContext); }
/** * Write the given HFileKeyValue to the MR context. * * <p>The key value is written as the mapper key with a null writable value.</p> * * @param mrKey The HFileKeyValue to write out. * @throws IOException on I/O error or interruption. */ private void write(final HFileKeyValue mrKey) throws IOException { try { getMapReduceContext().write(mrKey, NULL); } catch (InterruptedException ie) { throw new IOException(ie); } }
/** {@inheritDoc} */ @Override protected void cleanup(Context context) throws IOException { Preconditions.checkNotNull(mContext); mPivoter.cleanup(mContext); mContext.close(); mContext = null; super.cleanup(context); }
@Override public void close() throws IOException { ResourceUtils.closeOrLog(mReader); ResourceUtils.releaseOrLog(mTable); ResourceUtils.releaseOrLog(mFiji); super.close(); } }
@Override public void setConf(Configuration conf) { super.setConf(conf); setGatherer(createGatherer(conf)); }
/** {@inheritDoc} */ @Override public void flush() throws IOException { mWriter.flush(); super.flush(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { mWriter.close(); mTable.release(); mFiji.release(); super.close(); } }