/** * Gets the layout of the Fiji table. * * @return The table layout. */ public FijiTableLayout getTableLayout() { return HBaseFijiTable.downcast(mFijiTable).getLayout(); }
/** * Loads partitioned HFiles directly into the regions of a Fiji table. * * @param hfilePath The path to the HFiles generated by a bulk-import job. * @param table The target fiji table. * @throws IOException If there is an error. */ public void load(Path hfilePath, FijiTable table) throws IOException { HBaseFijiTable.downcast(table).bulkLoad(hfilePath); } }
/** * Reports the HBase table name for the specified Fiji table. * * @param table Fiji table to report the HBase table name of. * @return the HBase table name for the specified Fiji table. * @throws java.io.IOException on I/O error. */ private static byte[] getHBaseTableName(FijiTable table) throws IOException { final HBaseFijiTable htable = HBaseFijiTable.downcast(table); final HTableInterface hti = htable.openHTableConnection(); try { return hti.getTableName(); } finally { hti.close(); } }
/** {@inheritDoc} */ @Override public List<InputSplit> getSplits(JobContext context) throws IOException { final Configuration conf = context.getConfiguration(); final FijiURI inputTableURI = getInputTableURI(conf); final Fiji fiji = Fiji.Factory.open(inputTableURI, conf); final FijiTable table = fiji.openTable(inputTableURI.getTable()); final HTableInterface htable = HBaseFijiTable.downcast(table).openHTableConnection(); try { final List<InputSplit> splits = Lists.newArrayList(); for (FijiRegion region : table.getRegions()) { final byte[] startKey = region.getStartKey(); // TODO: a smart way to get which location is most relevant. final String location = region.getLocations().isEmpty() ? null : region.getLocations().iterator().next(); final TableSplit tableSplit = new TableSplit( htable.getTableName(), startKey, region.getEndKey(), location); splits.add(new FijiTableSplit(tableSplit, startKey)); } return splits; } finally { htable.close(); } }