@Test public void testDelete() { HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); insertToDatabase(); Status deleteStatus = myClient.delete(TEST_TABLE, DEFAULT_ROW_KEY); assertEquals(deleteStatus, Status.OK); Status readStatus = myClient.read(TEST_TABLE, DEFAULT_ROW_KEY, null, result); assertEquals(readStatus, Status.ERROR); assertEquals(result.size(), 0); }
public Status delete(String table, String key) { try { Object rowKey = makeRowKey(key); String containerKey = makeContainerKey(key); final Container<Object, Row> container = store.getContainer(containerKey); if(container == null) { LOGGER.severe("[ERROR]getCollection " + containerKey + " in read()"); return Status.ERROR; } boolean isDelete = container.remove(rowKey); if (!isDelete) { LOGGER.severe("[ERROR]remove(rowKey) in remove()"); return Status.ERROR; } }catch (GSException e) { LOGGER.severe("Exception: " + e.getMessage()); return Status.ERROR; } return Status.OK; }
GridDBClient extends com.yahoo.ycsb.DB { public Status delete(String table, String key) { try { Object rowKey = makeRowKey(key); String containerKey = makeContainerKey(key); final Container<Object, Row> container = store.getContainer(containerKey); if(container == null) { LOGGER.severe("[ERROR]getCollection " + containerKey + " in read()"); return Status.ERROR; } boolean isDelete = container.remove(rowKey); if (!isDelete) { LOGGER.severe("[ERROR]remove(rowKey) in remove()"); return Status.ERROR; } }catch (GSException e) { LOGGER.severe("Exception: " + e.getMessage()); return Status.ERROR; } return Status.OK; } }
GridDBClient extends com.yahoo.ycsb.DB { public Status delete(String table, String key) { try { Object rowKey = makeRowKey(key); String containerKey = makeContainerKey(key); final Container<Object, Row> container = store.getContainer(containerKey); if(container == null) { LOGGER.severe("[ERROR]getCollection " + containerKey + " in read()"); return Status.ERROR; } boolean isDelete = container.remove(rowKey); if (!isDelete) { LOGGER.severe("[ERROR]remove(rowKey) in remove()"); return Status.ERROR; } }catch (GSException e) { LOGGER.severe("Exception: " + e.getMessage()); return Status.ERROR; } return Status.OK; }  }
GridDBClient extends com.yahoo.ycsb.DB { public Status delete(String table, String key) { try { Object rowKey = makeRowKey(key); String containerKey = makeContainerKey(key); final Container<Object, Row> container = store.getContainer(containerKey); if(container == null) { LOGGER.severe("[ERROR]getCollection " + containerKey + " in read()"); return Status.ERROR; } boolean isDelete = container.remove(rowKey); if (!isDelete) { LOGGER.severe("[ERROR]remove(rowKey) in remove()"); return Status.ERROR; } }catch (GSException e) { LOGGER.severe("Exception: " + e.getMessage()); return Status.ERROR; } return Status.OK; }  void init(); void cleanup(); Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result); Status scan(String table, String startkey, int recordcount, Set<String> fields,
          Vector<HashMap<String, ByteIterator>> result); Status update(String table, String key, Map<String, ByteIterator> values); Status insert(String table, String key, Map<String, ByteIterator> values); Status delete(String table, String key); }
GridDBClient extends com.yahoo.ycsb.DB { public Status delete(String table, String key) { try { Object rowKey = makeRowKey(key); String containerKey = makeContainerKey(key); final Container<Object, Row> container = store.getContainer(containerKey); if(container == null) { LOGGER.severe("[ERROR]getCollection " + containerKey + " in read()"); return Status.ERROR; } boolean isDelete = container.remove(rowKey); if (!isDelete) { LOGGER.severe("[ERROR]remove(rowKey) in remove()"); return Status.ERROR; } }catch (GSException e) { LOGGER.severe("Exception: " + e.getMessage()); return Status.ERROR; } return Status.OK; }  void init(); void cleanup(); Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result); Status scan(String table, String startkey, int recordcount, Set<String> fields,
          Vector<HashMap<String, ByteIterator>> result); Status update(String table, String key, Map<String, ByteIterator> values); Status insert(String table, String key, Map<String, ByteIterator> values); Status delete(String table, String key); static final String VALUE_COLUMN_NAME_PREFIX; static final int ROW_KEY_COLUMN_POS; static final int DEFAULT_CACHE_CONTAINER_NUM; static final int FIELD_NUM; static final GSType SCHEMA_TYPE; }