@Override public RowIterator get(ScannerConfiguration config) { // TODO log something better (see fluo-425) log.trace("txid: {} get(ScannerConfiguration)", txid); return tx.get(config); }
@Override public Bytes get(Bytes row, Column column) { checkIfOpen(); // TODO cache? precache? return get(row, Collections.singleton(column)).get(column); }
@Override public Map<Column, Bytes> get(Bytes row, Set<Column> columns) { Map<Column, Bytes> ret = tx.get(row, columns); if (log.isTraceEnabled()) { log.trace("txid: {} get({}, {}) -> {}", txid, enc(row), encC(columns), encC(ret)); } return ret; }
@Override public Bytes get(Bytes row, Column column) { Bytes ret = tx.get(row, column); if (log.isTraceEnabled()) { log.trace("txid: {} get({}, {}) -> {}", txid, enc(row), enc(column), enc(ret)); } return ret; }
@Override public Map<Bytes, Map<Column, Bytes>> get(Collection<Bytes> rows, Set<Column> columns) { Map<Bytes, Map<Column, Bytes>> ret = tx.get(rows, columns); if (log.isTraceEnabled()) { log.trace("txid: {} get({}, {}) -> {}", txid, encB(rows), encC(columns), encRC(ret)); } return ret; }
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { try { ByteArrayInputStream bais = new ByteArrayInputStream(context.getConfiguration().get(PROPS_CONF_KEY) .getBytes("UTF-8")); PropertiesConfiguration props = new PropertiesConfiguration(); props.load(bais); env = new Environment(new FluoConfiguration(props)); ti = new TransactionImpl(env, context.getConfiguration().getLong(TIMESTAMP_CONF_KEY, -1)); // TODO this uses non public Accumulo API! RangeInputSplit ris = (RangeInputSplit) split; Span span = SpanUtil.toSpan(ris.getRange()); ScannerConfiguration sc = new ScannerConfiguration().setSpan(span); for (String fam : context.getConfiguration().getStrings(FAMS_CONF_KEY, new String[0])) { sc.fetchColumnFamily(Bytes.of(fam)); } rowIter = ti.get(sc); } catch (Exception e) { throw new IOException(e); } }
@Override public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { try { ByteArrayInputStream bais = new ByteArrayInputStream(context.getConfiguration().get(PROPS_CONF_KEY) .getBytes("UTF-8")); PropertiesConfiguration props = new PropertiesConfiguration(); props.load(bais); env = new Environment(new FluoConfiguration(props)); ti = new TransactionImpl(env, context.getConfiguration().getLong(TIMESTAMP_CONF_KEY, -1)); // TODO this uses non public Accumulo API! RangeInputSplit ris = (RangeInputSplit) split; Span span = SpanUtil.toSpan(ris.getRange()); ScannerConfiguration sc = new ScannerConfiguration().setSpan(span); for (String fam : context.getConfiguration().getStrings(FAMS_CONF_KEY, new String[0])) { sc.fetchColumnFamily(Bytes.of(fam)); } rowIter = ti.get(sc); } catch (Exception e) { throw new IOException(e); } }