public void write(Text table, Mutation mutation) throws IOException {
      if(table == null || table.toString().isEmpty()) {
        table = this.defaultTableName;
      }

      if(!this.simulate && table == null) {
        throw new IOException("No table or default table specified. Try simulation mode next time");
      } else {
        ++this.mutCount;
        this.valCount += (long)mutation.size();
        this.printMutation(table, mutation);
        if(!this.simulate) {
          if(!this.bws.containsKey(table)) {
            try {
              this.addTable(table);
            } catch (Exception var5) {
              LOG.error("Could not add table", var5);
              throw new IOException(var5);
            }
          }
          if(indexTableName != null && !this.bws.containsKey(indexTableName)) {
            try {
              this.addTable(indexTableName);
            } catch (Exception var6) {
              LOG.error("Could not add index table", var6);
              throw new IOException(var6);
            }
          }

          try {
            ((BatchWriter)this.bws.get(table)).addMutation(mutation);
          } catch (MutationsRejectedException var4) {
            throw new IOException(var4);
          }

          // if this table has an associated index table then attempt to build
          // index mutations
          if (indexTableName != null) {
            List<Mutation> idxMuts = getIndexMutations(mutation);
            if (!idxMuts.isEmpty()) {
              try {
                BatchWriter writer = this.bws.get(indexTableName);
                for (Mutation m : idxMuts) {
                  writer.addMutation(m);
                }
              } catch (MutationsRejectedException var4) {
                throw new IOException(var4);
              }
            }
          }
        }
      }
    }
Extension of AccumuloOutputFormat to support indexing.
accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/mr/AccumuloIndexedOutputFormat.java