@Override public void create(String tableName, NewTableConfiguration ntc) throws AccumuloException, AccumuloSecurityException, TableExistsException { checkArgument(tableName != null, "tableName is null"); checkArgument(ntc != null, "ntc is null"); List<ByteBuffer> args = new ArrayList<>(); args.add(ByteBuffer.wrap(tableName.getBytes(UTF_8))); args.add(ByteBuffer.wrap(ntc.getTimeType().name().getBytes(UTF_8))); // Send info relating to initial table creation i.e, create online or offline args.add(ByteBuffer.wrap(ntc.getInitialTableState().name().getBytes(UTF_8))); // Check for possible initial splits to be added at table creation // Always send number of initial splits to be created, even if zero. If greater than zero, // add the splits to the argument List which will be used by the FATE operations. int numSplits = ntc.getSplits().size(); args.add(ByteBuffer.wrap(String.valueOf(numSplits).getBytes(UTF_8))); if (numSplits > 0) { for (Text t : ntc.getSplits()) { args.add(TextUtil.getByteBuffer(t)); } } Map<String,String> opts = ntc.getProperties(); try { doTableFateOperation(tableName, AccumuloException.class, FateOperation.TABLE_CREATE, args, opts); } catch (TableNotFoundException e) { // should not happen throw new AssertionError(e); } }
TimeType timeType = TimeType.valueOf(ByteBufferUtil.toString(arguments.get(1))); InitialTableState initialTableState = InitialTableState .valueOf(ByteBufferUtil.toString(arguments.get(2))); int splitCount = Integer.parseInt(ByteBufferUtil.toString(arguments.get(3))); String splitFile = null;