protected AccumuloRecordWriter(TaskAttemptContext context) throws AccumuloException, AccumuloSecurityException, IOException { Level l = getLogLevel(context); if (l != null) log.setLevel(getLogLevel(context)); this.simulate = getSimulationMode(context); this.createTables = canCreateTables(context); if (simulate) log.info("Simulating output only. No writes to tables will occur"); this.bws = new HashMap<>(); String tname = getDefaultTableName(context); this.defaultTableName = (tname == null) ? null : new Text(tname); if (!simulate) { this.client = OutputConfigurator.client(CLASS, context.getConfiguration()); mtbw = client.createMultiTableBatchWriter(getBatchWriterOptions(context)); } }
protected AccumuloRecordWriter(TaskAttemptContext context) throws AccumuloException, AccumuloSecurityException, IOException { Level l = getLogLevel(context); if (l != null) log.setLevel(getLogLevel(context)); this.simulate = getSimulationMode(context); this.createTables = canCreateTables(context); if (simulate) log.info("Simulating output only. No writes to tables will occur"); this.bws = new HashMap<>(); String tname = getDefaultTableName(context); this.defaultTableName = (tname == null) ? null : new Text(tname); if (!simulate) { this.client = Accumulo.newClient().usingClientInfo(getClientInfo(context)).build(); mtbw = client.createMultiTableBatchWriter(getBatchWriterOptions(context)); } }
protected AccumuloRecordWriter(TaskAttemptContext context) throws AccumuloException, AccumuloSecurityException, IOException { Level l = getLogLevel(context); if (l != null) log.setLevel(getLogLevel(context)); this.simulate = getSimulationMode(context); this.createTables = canCreateTables(context); if (simulate) log.info("Simulating output only. No writes to tables will occur"); this.bws = new HashMap<>(); String tname = getDefaultTableName(context); this.defaultTableName = (tname == null) ? null : new Text(tname); if (!simulate) { this.conn = getInstance(context).getConnector(getPrincipal(context), getAuthenticationToken(context)); mtbw = conn.createMultiTableBatchWriter(getBatchWriterOptions(context)); } }