@Test(expected = IllegalArgumentException.class) public void testNegativeSplitBits() { HalyardTableUtils.calculateSplits(-1); }
static byte[][] calculateSplits(int splitBits) { TreeSet<byte[]> splitKeys = new TreeSet<>(Bytes.BYTES_COMPARATOR); splitKeys.add(new byte[]{POS_PREFIX}); splitKeys.add(new byte[]{OSP_PREFIX}); splitKeys.add(new byte[]{CSPO_PREFIX}); splitKeys.add(new byte[]{CPOS_PREFIX}); splitKeys.add(new byte[]{COSP_PREFIX}); addSplits(splitKeys, new byte[]{SPO_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{POS_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{OSP_PREFIX}, splitBits); return splitKeys.toArray(new byte[splitKeys.size()][]); }
HalyardTableUtils { static byte[][] calculateSplits(int splitBits) { TreeSet<byte[]> splitKeys = new TreeSet<>(Bytes.BYTES_COMPARATOR); splitKeys.add(new byte[]{POS_PREFIX}); splitKeys.add(new byte[]{OSP_PREFIX}); splitKeys.add(new byte[]{CSPO_PREFIX}); splitKeys.add(new byte[]{CPOS_PREFIX}); splitKeys.add(new byte[]{COSP_PREFIX}); addSplits(splitKeys, new byte[]{SPO_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{POS_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{OSP_PREFIX}, splitBits); return splitKeys.toArray(new byte[splitKeys.size()][]); } }
HalyardTableUtils { static byte[][] calculateSplits(int splitBits) { TreeSet<byte[]> splitKeys = new TreeSet<>(Bytes.BYTES_COMPARATOR); splitKeys.add(new byte[]{POS_PREFIX}); splitKeys.add(new byte[]{OSP_PREFIX}); splitKeys.add(new byte[]{CSPO_PREFIX}); splitKeys.add(new byte[]{CPOS_PREFIX}); splitKeys.add(new byte[]{COSP_PREFIX}); addSplits(splitKeys, new byte[]{SPO_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{POS_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{OSP_PREFIX}, splitBits); return splitKeys.toArray(new byte[splitKeys.size()][]); }  }
HalyardTableUtils { static byte[][] calculateSplits(int splitBits) { TreeSet<byte[]> splitKeys = new TreeSet<>(Bytes.BYTES_COMPARATOR); splitKeys.add(new byte[]{POS_PREFIX}); splitKeys.add(new byte[]{OSP_PREFIX}); splitKeys.add(new byte[]{CSPO_PREFIX}); splitKeys.add(new byte[]{CPOS_PREFIX}); splitKeys.add(new byte[]{COSP_PREFIX}); addSplits(splitKeys, new byte[]{SPO_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{POS_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{OSP_PREFIX}, splitBits); return splitKeys.toArray(new byte[splitKeys.size()][]); }  static HTable getTable(Configuration config, String tableName, boolean create, int splitBits); static HTable getTable(Configuration config, String tableName, boolean create, byte[][] splits); static HTable truncateTable(HTable table); static KeyValue[] toKeyValues(Resource subj, IRI pred, Value obj, Resource context, boolean delete, long timestamp); static Scan scan(Resource subj, IRI pred, Value obj, Resource ctx); static Scan scan(byte[] subjHash, byte[] predHash, byte[] objHash, byte[] ctxHash); static List<Statement> parseStatements(Result res, ValueFactory vf); static Statement parseStatement(Cell c, ValueFactory vf); static Scan scan(byte[] startRow, byte[] stopRow); static byte[] concat(byte prefix, boolean trailingZero, byte[]...fragments); static byte[] hashKey(byte[] key); static byte[] hashKey(Value v); static String encode(byte b[]); static byte[] writeBytes(Value v); static Value readValue(byte[] b, ValueFactory vf); static Resource readResource(byte[] b, ValueFactory vf); static IRI readIRI(byte[] b, ValueFactory vf); }
HalyardTableUtils { static byte[][] calculateSplits(int splitBits) { TreeSet<byte[]> splitKeys = new TreeSet<>(Bytes.BYTES_COMPARATOR); splitKeys.add(new byte[]{POS_PREFIX}); splitKeys.add(new byte[]{OSP_PREFIX}); splitKeys.add(new byte[]{CSPO_PREFIX}); splitKeys.add(new byte[]{CPOS_PREFIX}); splitKeys.add(new byte[]{COSP_PREFIX}); addSplits(splitKeys, new byte[]{SPO_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{POS_PREFIX}, splitBits); addSplits(splitKeys, new byte[]{OSP_PREFIX}, splitBits); return splitKeys.toArray(new byte[splitKeys.size()][]); }  static HTable getTable(Configuration config, String tableName, boolean create, int splitBits); static HTable getTable(Configuration config, String tableName, boolean create, byte[][] splits); static HTable truncateTable(HTable table); static KeyValue[] toKeyValues(Resource subj, IRI pred, Value obj, Resource context, boolean delete, long timestamp); static Scan scan(Resource subj, IRI pred, Value obj, Resource ctx); static Scan scan(byte[] subjHash, byte[] predHash, byte[] objHash, byte[] ctxHash); static List<Statement> parseStatements(Result res, ValueFactory vf); static Statement parseStatement(Cell c, ValueFactory vf); static Scan scan(byte[] startRow, byte[] stopRow); static byte[] concat(byte prefix, boolean trailingZero, byte[]...fragments); static byte[] hashKey(byte[] key); static byte[] hashKey(Value v); static String encode(byte b[]); static byte[] writeBytes(Value v); static Value readValue(byte[] b, ValueFactory vf); static Resource readResource(byte[] b, ValueFactory vf); static IRI readIRI(byte[] b, ValueFactory vf); static final byte SPO_PREFIX; static final byte POS_PREFIX; static final byte OSP_PREFIX; static final byte CSPO_PREFIX; static final byte CPOS_PREFIX; static final byte COSP_PREFIX; static final byte KEY_SIZE; static final byte[] STOP_KEY; }