@Override public RecordWriter<Text,Mutation> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { try { return new AccumuloRecordWriter(job); } catch (Exception e) { throw new IOException(e); } }
/** * Push a mutation into a table. If table is null, the defaultTable will be used. If * {@link AccumuloOutputFormat#canCreateTables(JobConf)} is set, the table will be created if it * does not exist. The table name must only contain alphanumerics and underscore. */ @Override public void write(Text table, Mutation mutation) throws IOException { if (table == null || table.toString().isEmpty()) table = this.defaultTableName; if (!simulate && table == null) throw new IOException("No table or default table specified. Try simulation mode next time"); ++mutCount; valCount += mutation.size(); printMutation(table, mutation); if (simulate) return; if (!bws.containsKey(table)) try { addTable(table); } catch (final Exception e) { log.error("Could not add table '" + table + "'", e); throw new IOException(e); } try { bws.get(table).addMutation(mutation); } catch (MutationsRejectedException e) { throw new IOException(e); } }
private int printMutation(Text table, Mutation m) { if (log.isTraceEnabled()) { log.trace(String.format("Table %s row key: %s", table, hexDump(m.getRow()))); for (ColumnUpdate cu : m.getUpdates()) { log.trace(String.format("Table %s column: %s:%s", table, hexDump(cu.getColumnFamily()), hexDump(cu.getColumnQualifier()))); log.trace(String.format("Table %s security: %s", table, new ColumnVisibility(cu.getColumnVisibility()).toString())); log.trace(String.format("Table %s value: %s", table, hexDump(cu.getValue()))); } } return m.getUpdates().size(); }
/** * Push a mutation into a table. If table is null, the defaultTable will be used. If * {@link AccumuloOutputFormat#canCreateTables(JobConf)} is set, the table will be created if it * does not exist. The table name must only contain alphanumerics and underscore. */ @Override public void write(Text table, Mutation mutation) throws IOException { if (table == null || table.toString().isEmpty()) table = this.defaultTableName; if (!simulate && table == null) throw new IOException("No table or default table specified. Try simulation mode next time"); ++mutCount; valCount += mutation.size(); printMutation(table, mutation); if (simulate) return; if (!bws.containsKey(table)) try { addTable(table); } catch (final Exception e) { log.error("Could not add table '" + table.toString() + "'", e); throw new IOException(e); } try { bws.get(table).addMutation(mutation); } catch (MutationsRejectedException e) { throw new IOException(e); } }
/** * Push a mutation into a table. If table is null, the defaultTable will be used. If * {@link AccumuloOutputFormat#canCreateTables(JobConf)} is set, the table will be created if it * does not exist. The table name must only contain alphanumerics and underscore. */ @Override public void write(Text table, Mutation mutation) throws IOException { if (table == null || table.toString().isEmpty()) table = this.defaultTableName; if (!simulate && table == null) throw new IOException("No table or default table specified. Try simulation mode next time"); ++mutCount; valCount += mutation.size(); printMutation(table, mutation); if (simulate) return; if (!bws.containsKey(table)) try { addTable(table); } catch (final Exception e) { log.error("Could not add table '" + table + "'", e); throw new IOException(e); } try { bws.get(table).addMutation(mutation); } catch (MutationsRejectedException e) { throw new IOException(e); } }
private int printMutation(Text table, Mutation m) { if (log.isTraceEnabled()) { log.trace(String.format("Table %s row key: %s", table, hexDump(m.getRow()))); for (ColumnUpdate cu : m.getUpdates()) { log.trace(String.format("Table %s column: %s:%s", table, hexDump(cu.getColumnFamily()), hexDump(cu.getColumnQualifier()))); log.trace(String.format("Table %s security: %s", table, new ColumnVisibility(cu.getColumnVisibility()).toString())); log.trace(String.format("Table %s value: %s", table, hexDump(cu.getValue()))); } } return m.getUpdates().size(); }
private int printMutation(Text table, Mutation m) { if (log.isTraceEnabled()) { log.trace(String.format("Table %s row key: %s", table, hexDump(m.getRow()))); for (ColumnUpdate cu : m.getUpdates()) { log.trace(String.format("Table %s column: %s:%s", table, hexDump(cu.getColumnFamily()), hexDump(cu.getColumnQualifier()))); log.trace(String.format("Table %s security: %s", table, new ColumnVisibility(cu.getColumnVisibility()).toString())); log.trace(String.format("Table %s value: %s", table, hexDump(cu.getValue()))); } } return m.getUpdates().size(); }
@Override public RecordWriter<Text,Mutation> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { try { return new AccumuloRecordWriter(job); } catch (Exception e) { throw new IOException(e); } }
@Override public RecordWriter<Text,Mutation> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { try { return new AccumuloRecordWriter(job); } catch (Exception e) { throw new IOException(e); } }