@Test public void testDelete() throws Exception { cluster.cache(DEFAULT_CACHE_NAME).clear(); final String key1 = "key1"; final Map<String, String> input1 = new HashMap<>(); input1.put("field0", "value1"); input1.put("field1", "value2"); final Status status1 = client.insert(TABLE_NAME, key1, StringByteIterator.getByteIteratorMap(input1)); assertThat(status1, is(Status.OK)); assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(1)); final String key2 = "key2"; final Map<String, String> input2 = new HashMap<>(); input2.put("field0", "value1"); input2.put("field1", "value2"); final Status status2 = client.insert(TABLE_NAME, key2, StringByteIterator.getByteIteratorMap(input2)); assertThat(status2, is(Status.OK)); assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(2)); final Status status3 = client.delete(TABLE_NAME, key2); assertThat(status3, is(Status.OK)); assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(1)); }
@Override public Status delete(String table, String key) { try { StringBuilder sb = new StringBuilder("DELETE FROM ").append(table) .append(" WHERE ").append(PRIMARY_KEY).append(" = ?"); SqlFieldsQuery qry = new SqlFieldsQuery(sb.toString()); qry.setArgs(key); cache.query(qry).getAll(); return Status.OK; } catch (Exception e) { log.error(String.format("Error in processing read from table: %s", table), e); return Status.ERROR; } }
IgniteSqlClient extends IgniteAbstractClient { @Override public Status delete(String table, String key) { try { StringBuilder sb = new StringBuilder("DELETE FROM ").append(table) .append(" WHERE ").append(PRIMARY_KEY).append(" = ?"); SqlFieldsQuery qry = new SqlFieldsQuery(sb.toString()); qry.setArgs(key); cache.query(qry).getAll(); return Status.OK; } catch (Exception e) { log.error(String.format("Error in processing read from table: %s", table), e); return Status.ERROR; } } }
IgniteSqlClient extends IgniteAbstractClient { @Override public Status delete(String table, String key) { try { StringBuilder sb = new StringBuilder("DELETE FROM ").append(table) .append(" WHERE ").append(PRIMARY_KEY).append(" = ?"); SqlFieldsQuery qry = new SqlFieldsQuery(sb.toString()); qry.setArgs(key); cache.query(qry).getAll(); return Status.OK; } catch (Exception e) { log.error(String.format("Error in processing read from table: %s", table), e); return Status.ERROR; } }  }
IgniteSqlClient extends IgniteAbstractClient { @Override public Status delete(String table, String key) { try { StringBuilder sb = new StringBuilder("DELETE FROM ").append(table) .append(" WHERE ").append(PRIMARY_KEY).append(" = ?"); SqlFieldsQuery qry = new SqlFieldsQuery(sb.toString()); qry.setArgs(key); cache.query(qry).getAll(); return Status.OK; } catch (Exception e) { log.error(String.format("Error in processing read from table: %s", table), e); return Status.ERROR; } }  @Override Status read(String table, String key, Set<String> fields,
                     Map<String, ByteIterator> result); @Override Status update(String table, String key,
                       Map<String, ByteIterator> values); @Override Status insert(String table, String key, Map<String, ByteIterator> values); @Override Status delete(String table, String key); }
IgniteSqlClient extends IgniteAbstractClient { @Override public Status delete(String table, String key) { try { StringBuilder sb = new StringBuilder("DELETE FROM ").append(table) .append(" WHERE ").append(PRIMARY_KEY).append(" = ?"); SqlFieldsQuery qry = new SqlFieldsQuery(sb.toString()); qry.setArgs(key); cache.query(qry).getAll(); return Status.OK; } catch (Exception e) { log.error(String.format("Error in processing read from table: %s", table), e); return Status.ERROR; } }  @Override Status read(String table, String key, Set<String> fields,
                     Map<String, ByteIterator> result); @Override Status update(String table, String key,
                       Map<String, ByteIterator> values); @Override Status insert(String table, String key, Map<String, ByteIterator> values); @Override Status delete(String table, String key);  }