.listConstraints(tableName).entrySet()) { shellState.getReader().println(property.toString());
@Override public Map<String,Integer> listConstraints(ByteBuffer login, String tableName) throws org.apache.accumulo.proxy.thrift.AccumuloException, org.apache.accumulo.proxy.thrift.TableNotFoundException, TException { try { return getConnector(login).tableOperations().listConstraints(tableName); } catch (Exception e) { handleExceptionTNF(e); return null; } }
@Test public void run() throws Exception { String[] tableNames = getUniqueNames(3); Connector c = getConnector(); for (String table : tableNames) { c.tableOperations().create(table); c.tableOperations().addConstraint(table, NumericValueConstraint.class.getName()); c.tableOperations().addConstraint(table, AlphaNumKeyConstraint.class.getName()); } // A static sleep to just let ZK do its thing Thread.sleep(10 * 1000); // Then check that the client has at least gotten the updates for (String table : tableNames) { log.debug("Checking constraints on {}", table); Map<String,Integer> constraints = c.tableOperations().listConstraints(table); while (!constraints.containsKey(NumericValueConstraint.class.getName()) || !constraints.containsKey(AlphaNumKeyConstraint.class.getName())) { log.debug("Failed to verify constraints. Sleeping and retrying"); Thread.sleep(2000); constraints = c.tableOperations().listConstraints(table); } log.debug("Verified all constraints on {}", table); } log.debug("Verified constraints on all tables. Running tests"); test1(tableNames[0]); test2(tableNames[1], false); test2(tableNames[2], true); }
assertFalse(c.tableOperations().listConstraints(t1).containsKey(constraintClassName)); continue; if (!c.tableOperations().listConstraints(t1).containsKey(constraintClassName)) { Thread.sleep(500); continue; continue; Integer tableNum = c.tableOperations().listConstraints(t1).get(constraintClassName); if (null == tableNum) { Thread.sleep(500); continue; if (c.tableOperations().listConstraints(t1).containsKey(constraintClassName)) { Thread.sleep(500); continue;
.listConstraints(tableName).entrySet()) { shellState.getReader().println(property.toString());
break; case 20: ops.listConstraints(tableName); fail(); break;