public int insertEntity( String entitySet, String entityPK, HashMap<String, ByteIterator> values, boolean insertImage) { // TODO Auto-generated method stub /* Insert into table */ try { long mutator = client.mutator_open(namespace, entitySet, 0, 0); List<Cell> cells = new ArrayList<Cell>(); Key key = null; Cell cell = null; for (HashMap.Entry<String, ByteIterator> entry : values.entrySet()) { key = new Key(entityPK, entry.getKey(), null, KeyFlag.INSERT); cell = new Cell(key); cell.setValue(entry.getValue().toArray()); cells.add(cell); } client.mutator_set_cells(mutator, cells); client.mutator_flush(mutator); cells.clear(); client.mutator_close(mutator); } catch (ClientException e) { // TODO Auto-generated catch block e.printStackTrace(); return -1; } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return -1; } return 0; }