description
stringlengths
11
2.86k
focal_method
stringlengths
70
6.25k
test_case
stringlengths
96
15.3k
["('/**\\\\n * Validates that the provided reader schema can be used to decode avro data written with the\\\\n * provided writer schema.\\\\n *\\\\n * @param reader schema to check.\\\\n * @param writer schema to check.\\\\n * @return a result object identifying any compatibility errors.\\\\n */', '')"]
b'/**\n * Validates that the provided reader schema can be used to decode avro data written with the\n * provided writer schema.\n *\n * @param reader schema to check.\n * @param writer schema to check.\n * @return a result object identifying any compatibility errors.\n */'public static SchemaPairCompatib...
@Test public void testReaderWriterIncompatibility() { for (ReaderWriter readerWriter : INCOMPATIBLE_READER_WRITER_TEST_CASES) { final Schema reader = readerWriter.getReader(); final Schema writer = readerWriter.getWriter(); LOG.debug("Testing incompatibility of reader {} with writer {}.", r...
Validates that the provided reader schemas can be used to decode data written with the provided writer schema @param readers that must be able to be used to decode data encoded with the provided writer schema @param writer schema to check @return a list of compatibility results Check compatibility between each read...
b'/**\n * Validates that the provided reader schemas can be used to decode data written with the provided\n * writer schema.\n *\n * @param readers that must be able to be used to decode data encoded with the provided writer\n * schema.\n * @param writer schema to check.\n * @return a list of compatib...
@Test public void testCheckWriterCompatibility() throws Exception { // Setup schema fields. final List<Schema.Field> writerFields = Lists.newArrayList( new Schema.Field("oldfield1", INT_SCHEMA, null, null), new Schema.Field("oldfield2", STRING_SCHEMA, null, null)); final List<Schema....
Validates that the provided reader schema can read data written with the provided writer schemas @param reader schema to check @param writers that must be compatible with the provided reader schema @return a list of compatibility results Check compatibility between each readerwriter pair
b'/**\n * Validates that the provided reader schema can read data written with the provided writer\n * schemas.\n *\n * @param reader schema to check.\n * @param writers that must be compatible with the provided reader schema.\n * @return a list of compatibility results.\n */'public static SchemaSetCompat...
@Test public void testCheckReaderCompatibility() throws Exception { // Setup schema fields. final List<Schema.Field> writerFields1 = Lists.newArrayList( new Schema.Field("oldfield1", INT_SCHEMA, null, null), new Schema.Field("oldfield2", STRING_SCHEMA, null, null)); final List<Schema...
Compares two AvroSchema objects for equality within the context of the given SchemaTable @param schemaTable SchemaTable with which to resolve schema UIDs @param first one AvroSchema object to compare for equality @param second another AvroSchema object to compare for equality @return whether the two objects represent t...
b'/**\n * Compares two AvroSchema objects for equality within the context of the given SchemaTable.\n *\n * @param schemaTable SchemaTable with which to resolve schema UIDs.\n * @param first one AvroSchema object to compare for equality.\n * @param second another AvroSchema object to compare for equality.\n ...
@Test public void testAvroSchemaEquals() throws IOException { final KijiSchemaTable schemaTable = getKiji().getSchemaTable(); final long stringUID = schemaTable.getOrCreateSchemaId(STRING_SCHEMA); final long intUID = schemaTable.getOrCreateSchemaId(INT_SCHEMA); final String stringJSON = STRING_...
["('/**\\\\n * Check whether a collection of AvroSchema objects contains a given AvroSchema element, resolving\\\\n * UIDs using the given KijiSchemaTable.\\\\n *\\\\n * @param schemaTable KijiSchemaTable with which to resolve schema UIDs.\\\\n * @param schemaCollection collection of AvroSchemas to check for ...
b'/**\n * Check whether a collection of AvroSchema objects contains a given AvroSchema element, resolving\n * UIDs using the given KijiSchemaTable.\n *\n * @param schemaTable KijiSchemaTable with which to resolve schema UIDs.\n * @param schemaCollection collection of AvroSchemas to check for the presence of t...
@Test public void testAvroSchemaListContains() throws IOException { final KijiSchemaTable schemaTable = getKiji().getSchemaTable(); final long stringUID = schemaTable.getOrCreateSchemaId(STRING_SCHEMA); final long intUID = schemaTable.getOrCreateSchemaId(INT_SCHEMA); final String stringJSON = S...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testExtraPath() { try { KijiURI.newBuilder("kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col/extra"); fail("An exception should have been thrown."); } catch (KijiURIException kurie) { assertEquals("Invalid Kiji URI: 'kiji-hbase://(zkhost1,zkhost2):1234/" ...
["('/**\\\\n * Decodes a JSON encoded record.\\\\n *\\\\n * @param json JSON tree to decode, encoded as a string.\\\\n * @param schema Avro schema of the value to decode.\\\\n * @return the decoded value.\\\\n * @throws IOException on error.\\\\n */', '')"]
b'/**\n * Decodes a JSON encoded record.\n *\n * @param json JSON tree to decode, encoded as a string.\n * @param schema Avro schema of the value to decode.\n * @return the decoded value.\n * @throws IOException on error.\n */'public static Object fromJsonString(String json, Schema schema) throws IOExcept...
@Test public void testPrimitivesFromJson() throws Exception { assertEquals((Integer) 1, FromJson.fromJsonString("1", Schema.create(Schema.Type.INT))); assertEquals((Long) 1L, FromJson.fromJsonString("1", Schema.create(Schema.Type.LONG))); assertEquals((Float) 1.0f, FromJson.fromJsonString("1", Schema....
Hashes the input string @param input The string to hash @return The 128bit MD5 hash of the input
b'/**\n * Hashes the input string.\n *\n * @param input The string to hash.\n * @return The 128-bit MD5 hash of the input.\n */'public static byte[] hash(String input) { try { return hash(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e)...
@Test public void testHash() { assertArrayEquals(Hasher.hash("foo"), Hasher.hash("foo")); // 16 bytes = 128-bit MD5. assertEquals(16, Hasher.hash("bar").length); assertFalse(Arrays.equals(Hasher.hash("foo"), Hasher.hash("bar"))); }
Determines whether a string is a valid Java identifier pA valid Java identifier may not start with a number but may contain any combination of letters digits underscores or dollar signsp pSee the a hrefhttpjavasuncomdocsbooksjlsthirdeditionhtmllexicalhtml38 Java Language Specificationap @param identifier The identifier...
b'/**\n * Determines whether a string is a valid Java identifier.\n *\n * <p>A valid Java identifier may not start with a number, but may contain any\n * combination of letters, digits, underscores, or dollar signs.</p>\n *\n * <p>See the <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexica...
@Test public void testIsValidIdentifier() { assertFalse(JavaIdentifiers.isValidIdentifier("")); assertTrue(JavaIdentifiers.isValidIdentifier("a")); assertTrue(JavaIdentifiers.isValidIdentifier("B")); assertTrue(JavaIdentifiers.isValidIdentifier("_")); assertFalse(JavaIdentifiers.isValidIdent...
Determines whether a string could be the name of a Java class pIf this method returns true it does not necessarily mean that the Java class with codeclassNamecode exists it only means that one could write a Java class with that fullyqualified namep @param className A string to test @return Whether the class name was va...
b'/**\n * Determines whether a string could be the name of a Java class.\n *\n * <p>If this method returns true, it does not necessarily mean that the Java class with\n * <code>className</code> exists; it only means that one could write a Java class with\n * that fully-qualified name.</p>\n *\n * @param c...
@Test public void testIsValidClassName() { assertTrue(JavaIdentifiers.isValidClassName("org.kiji.schema.Foo")); assertFalse(JavaIdentifiers.isValidClassName("org.kiji.schema..Foo")); assertTrue(JavaIdentifiers.isValidClassName("org.kiji.schema.Foo$Bar")); assertTrue(JavaIdentifiers.isValidClassNa...
Utility class may not be instantiated
b'/** Utility class may not be instantiated. */'private JvmId() { }
@Test public void testJvmId() throws Exception { final String jvmId = JvmId.get(); LOG.info("JVM ID: {}", jvmId); assertEquals(jvmId, JvmId.get()); }
["('/**\\\\n * @return true if name is a valid name for a table, locality group, family,\\\\n * or column name, and false otherwise.\\\\n * @param name the name to check.\\\\n */', '')"]
b'/**\n * @return true if name is a valid name for a table, locality group, family,\n * or column name, and false otherwise.\n * @param name the name to check.\n */'public static boolean isValidLayoutName(CharSequence name) { return VALID_LAYOUT_NAME_PATTERN.matcher(name).matches(); }
@Test public void testIsValidIdentifier() { assertFalse(KijiNameValidator.isValidLayoutName("")); assertFalse(KijiNameValidator.isValidLayoutName("0123")); assertFalse(KijiNameValidator.isValidLayoutName("0123abc")); assertFalse(KijiNameValidator.isValidLayoutName("-asdb")); assertFalse(Kiji...
@return true if name is a valid alias for a table locality group family or column name and false otherwise @param name the name to check
b'/**\n * @return true if name is a valid alias for a table, locality group, family,\n * or column name, and false otherwise.\n * @param name the name to check.\n */'public static boolean isValidAlias(CharSequence name) { return VALID_ALIAS_PATTERN.matcher(name).matches(); }
@Test public void testIsValidAlias() { assertFalse(KijiNameValidator.isValidAlias("")); assertTrue(KijiNameValidator.isValidAlias("0123")); // Digits are ok in a leading capacity. assertTrue(KijiNameValidator.isValidAlias("0123abc")); assertTrue(KijiNameValidator.isValidAlias("abc-def")); // Dash...
["('/**\\\\n * @return true if name is a valid name for a Kiji instance and false otherwise.\\\\n * @param name the name to check.\\\\n */', '')"]
b'/**\n * @return true if name is a valid name for a Kiji instance and false otherwise.\n * @param name the name to check.\n */'public static boolean isValidKijiName(CharSequence name) { return VALID_INSTANCE_PATTERN.matcher(name).matches(); }
@Test public void testIsValidInstanceName() { assertFalse(KijiNameValidator.isValidKijiName("")); // empty string is disallowed here. assertTrue(KijiNameValidator.isValidKijiName("0123")); // leading digits are okay. assertTrue(KijiNameValidator.isValidKijiName("0123abc")); // leading digits are okay....
Returns the string representation of this ProtocolVersion that was initially parsed to create this ProtocolVersion Use @link toCanonicalString to get a string representation that preserves the equals relationship @inheritDoc
b'/**\n * Returns the string representation of this ProtocolVersion that was initially\n * parsed to create this ProtocolVersion. Use {@link #toCanonicalString()} to get\n * a string representation that preserves the equals() relationship.\n *\n * {@inheritDoc}\n */'@Override public String toString() { ...
@Test public void testToString() { ProtocolVersion pv1 = ProtocolVersion.parse("proto-1.2"); ProtocolVersion pv2 = ProtocolVersion.parse("proto-1.2.0"); assertEquals("proto-1.2", pv1.toString()); assertEquals("proto-1.2.0", pv2.toString()); assertTrue(pv1.equals(pv2)); assertEquals("p...
@inheritDoc
b'/** {@inheritDoc} */'@Override public boolean equals(Object other) { if (null == other) { return false; } else if (this == other) { return true; } else if (!(other instanceof ProtocolVersion)) { return false; } ProtocolVersion otherVer = (ProtocolVersion) other; ...
@Test public void testEquals() { ProtocolVersion pv1 = ProtocolVersion.parse("proto-1.2.3"); ProtocolVersion pv2 = ProtocolVersion.parse("proto-1.2.3"); assertTrue(pv1.equals(pv2)); assertTrue(pv2.equals(pv1)); assertEquals(pv1.hashCode(), pv2.hashCode()); assertEquals(0, pv1.compareTo(...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testURIWithQuery() { final KijiURI uri = KijiURI.newBuilder("kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col?query").build(); assertEquals("zkhost1", uri.getZookeeperQuorum().get(0)); assertEquals("zkhost2", uri.getZookeeperQuorum().get(1)); assertEquals(1234, ur...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testCompare() { List<ProtocolVersion> list = Arrays.asList( ProtocolVersion.parse("proto-1.10.0"), ProtocolVersion.parse("proto-1.3.1"), ProtocolVersion.parse("proto-2.1"), ProtocolVersion.parse("proto-0.4"), ProtocolVersion.parse("proto-2.0.0"), ...
Returns true if both are null or both are nonnull and thing1equalsthing2 @param thing1 an element to check @param thing2 the other element to check @return true if theyre both null or if thing1equalsthing2 false otherwise theyre both null
b"/**\n * Returns true if both are null, or both are non-null and\n * thing1.equals(thing2).\n *\n * @param thing1 an element to check\n * @param thing2 the other element to check\n * @return true if they're both null, or if thing1.equals(thing2);\n * false otherwise.\n */"static boolean checkEquality...
@Test public void testCheckEquality() { assertTrue(ProtocolVersion.checkEquality(null, null)); assertTrue(ProtocolVersion.checkEquality("hi", "hi")); assertFalse(ProtocolVersion.checkEquality("hi", null)); assertFalse(ProtocolVersion.checkEquality(null, "hi")); assertTrue(ProtocolVersion.che...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoJustProto() { try { ProtocolVersion.parse("proto"); } catch (IllegalArgumentException iae) { assertEquals("verString may contain at most one dash character, separating the protocol " + "name from the version number.", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoJustProto2() { try { ProtocolVersion.parse("proto-"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may contain at most one dash character, separating the protocol " + "name from...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testDashRequired() { try { ProtocolVersion.parse("foo1.4"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may contain at most one dash character, separating the protocol " + "name from...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoLeadingDash() { try { ProtocolVersion.parse("-foo-1.4"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may not start with a dash", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoMoreThan3() { try { ProtocolVersion.parse("1.2.3.4"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Version numbers may have at most three components.", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoMoreThan3withProto() { try { ProtocolVersion.parse("proto-1.2.3.4"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Version numbers may have at most three components.", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoLeadingDashWithoutProto() { try { ProtocolVersion.parse("-1.2.3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may not start with a dash", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoLeadingDashes() { try { ProtocolVersion.parse("--1.2.3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may not start with a dash", iae.getMessage()); } }
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testURIWithFragment() { final KijiURI uri = KijiURI.newBuilder("kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col#frag").build(); assertEquals("zkhost1", uri.getZookeeperQuorum().get(0)); assertEquals("zkhost2", uri.getZookeeperQuorum().get(1)); assertEquals(1234, ...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoMultiDash() { try { ProtocolVersion.parse("proto--1.2.3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may contain at most one dash character, separating the protocol " + "name...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoDashInProto() { try { ProtocolVersion.parse("proto-col-1.2.3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may contain at most one dash character, separating the protocol " + ...
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoNegativeMinor() { try { ProtocolVersion.parse("1.-2"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Minor version number must be non-negative.", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoNegativeRev() { try { ProtocolVersion.parse("1.2.-3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Revision number must be non-negative.", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoMultiDots() { try { ProtocolVersion.parse("1..2"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Could not parse numeric version info in 1..2", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoMultiDots2() { try { ProtocolVersion.parse("1..2.3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Version numbers may have at most three components.", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoNamedMinor() { try { ProtocolVersion.parse("1.x"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Could not parse numeric version info in 1.x", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoNamedMinorWithProto() { try { ProtocolVersion.parse("proto-1.x"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Could not parse numeric version info in proto-1.x", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoLeadingNumber() { try { ProtocolVersion.parse("2foo-1.3"); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("Could not parse numeric version info in 2foo-1.3", iae.getMessage()); } }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoEmptyString() { try { ProtocolVersion.parse(""); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may not be empty", iae.getMessage()); } }
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testPartialURIZookeeper() { final KijiURI uri = KijiURI.newBuilder("kiji-hbase://zkhost:1234").build(); assertEquals("zkhost", uri.getZookeeperQuorum().get(0)); assertEquals(1234, uri.getZookeeperClientPort()); assertEquals(null, uri.getInstance()); }
['(\'/**\\\\n * Static factory method that creates new ProtocolVersion instances.\\\\n *\\\\n * <p>This method parses its argument as a string of the form:\\\\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\\\\n * maj, min, and rev must be non-negative integers. protocol is ...
b'/**\n * Static factory method that creates new ProtocolVersion instances.\n *\n * <p>This method parses its argument as a string of the form:\n * <tt>protocol-maj.min.rev</tt>. All fields except the major digit are optional.\n * maj, min, and rev must be non-negative integers. protocol is a string; the trai...
@Test public void testNoNull() { try { ProtocolVersion.parse(null); fail("Should fail with an IllegalArgumentException"); } catch (IllegalArgumentException iae) { assertEquals("verString may not be null", iae.getMessage()); } }
["('/**\\\\n * Make a best effort at closing all the cached values. This method is *not* guaranteed to close\\\\n * every cached value if there are concurrent users of the cache. As a result, this method\\\\n * should only be relied upon if only a single thread is using this cache while {@code #close} is\\\\n ...
b'/**\n * Make a best effort at closing all the cached values. This method is *not* guaranteed to close\n * every cached value if there are concurrent users of the cache. As a result, this method\n * should only be relied upon if only a single thread is using this cache while {@code #close} is\n * called.\n ...
@Test(expected = IllegalStateException.class) public void closeableOnceFailsWhenDoubleClosed() throws Exception { Closeable closeable = new CloseableOnce<Object>(null); closeable.close(); closeable.close(); }
["('/**\\\\n * Constructs a split key file from an input stream. This object will take ownership of\\\\n * the inputStream, which you should clean up by calling close().\\\\n *\\\\n * @param inputStream The file contents.\\\\n * @return the region boundaries, as a list of row keys.\\\\n * @throws IOExcepti...
b'/**\n * Constructs a split key file from an input stream. This object will take ownership of\n * the inputStream, which you should clean up by calling close().\n *\n * @param inputStream The file contents.\n * @return the region boundaries, as a list of row keys.\n * @throws IOException on I/O error.\n ...
@Test public void testDecodeSplitKeyFile() throws Exception { final String content = "key1\n" + "key2\n"; final List<byte[]> keys = SplitKeyFile.decodeRegionSplitList(new ByteArrayInputStream(Bytes.toBytes(content))); assertEquals(2, keys.size()); assertArrayEquals(Byte...
["('/**\\\\n * Constructs a split key file from an input stream. This object will take ownership of\\\\n * the inputStream, which you should clean up by calling close().\\\\n *\\\\n * @param inputStream The file contents.\\\\n * @return the region boundaries, as a list of row keys.\\\\n * @throws IOExcepti...
b'/**\n * Constructs a split key file from an input stream. This object will take ownership of\n * the inputStream, which you should clean up by calling close().\n *\n * @param inputStream The file contents.\n * @return the region boundaries, as a list of row keys.\n * @throws IOException on I/O error.\n ...
@Test public void testDecodeSplitKeyFileNoEndNewLine() throws Exception { final String content = "key1\n" + "key2"; final List<byte[]> keys = SplitKeyFile.decodeRegionSplitList(new ByteArrayInputStream(Bytes.toBytes(content))); assertEquals(2, keys.size()); assertArrayE...
Decodes a string encoded row key @param encoded Encoded row key @return the row key as a byte array @throws IOException on IO error Escaped backslash Escaped byte in hexadecimal
b'/**\n * Decodes a string encoded row key.\n *\n * @param encoded Encoded row key.\n * @return the row key, as a byte array.\n * @throws IOException on I/O error.\n */'public static byte[] decodeRowKey(String encoded) throws IOException { final ByteArrayOutputStream os = new ByteArrayOutputStream(); ...
@Test public void testDecodeRowKey() throws Exception { assertArrayEquals(Bytes.toBytes("this is a \n key"), SplitKeyFile.decodeRowKey("this is a \n key")); assertArrayEquals(Bytes.toBytes("this is a \\ key"), SplitKeyFile.decodeRowKey("this is a \\\\ key")); assertArrayEquals(By...
["('/**\\\\n * Decodes a string encoded row key.\\\\n *\\\\n * @param encoded Encoded row key.\\\\n * @return the row key, as a byte array.\\\\n * @throws IOException on I/O error.\\\\n */', '')", "('', '// Escaped backslash:\\n')", "('', '// Escaped byte in hexadecimal:\\n')"]
b'/**\n * Decodes a string encoded row key.\n *\n * @param encoded Encoded row key.\n * @return the row key, as a byte array.\n * @throws IOException on I/O error.\n */'public static byte[] decodeRowKey(String encoded) throws IOException { final ByteArrayOutputStream os = new ByteArrayOutputStream(); ...
@Test public void testDecodeRowKeyInvalidHexEscape() throws Exception { try { SplitKeyFile.decodeRowKey("this is a \\xZZ key"); fail("An exception should have been thrown."); } catch (IOException ioe) { assertEquals("Invalid hexadecimal escape in encoded row key: 'this is a \\xZZ key'....
["('/**\\\\n * Decodes a string encoded row key.\\\\n *\\\\n * @param encoded Encoded row key.\\\\n * @return the row key, as a byte array.\\\\n * @throws IOException on I/O error.\\\\n */', '')", "('', '// Escaped backslash:\\n')", "('', '// Escaped byte in hexadecimal:\\n')"]
b'/**\n * Decodes a string encoded row key.\n *\n * @param encoded Encoded row key.\n * @return the row key, as a byte array.\n * @throws IOException on I/O error.\n */'public static byte[] decodeRowKey(String encoded) throws IOException { final ByteArrayOutputStream os = new ByteArrayOutputStream(); ...
@Test public void testDecodeRowKeyInvalidEscape() throws Exception { // \n is escaped as \x0a try { SplitKeyFile.decodeRowKey("this is a \\n key"); fail("An exception should have been thrown."); } catch (IOException ioe) { assertEquals("Invalid escape in encoded row key: 'this is ...
["('/**\\\\n * Decodes a string encoded row key.\\\\n *\\\\n * @param encoded Encoded row key.\\\\n * @return the row key, as a byte array.\\\\n * @throws IOException on I/O error.\\\\n */', '')", "('', '// Escaped backslash:\\n')", "('', '// Escaped byte in hexadecimal:\\n')"]
b'/**\n * Decodes a string encoded row key.\n *\n * @param encoded Encoded row key.\n * @return the row key, as a byte array.\n * @throws IOException on I/O error.\n */'public static byte[] decodeRowKey(String encoded) throws IOException { final ByteArrayOutputStream os = new ByteArrayOutputStream(); ...
@Test public void testDecodeRowKeyUnterminatedEscape() throws Exception { try { SplitKeyFile.decodeRowKey("this is a \\"); fail("An exception should have been thrown."); } catch (IOException ioe) { assertEquals("Invalid trailing escape in encoded row key: 'this is a \\'.", ioe.getMessa...
["('/**\\\\n * Decodes a string encoded row key.\\\\n *\\\\n * @param encoded Encoded row key.\\\\n * @return the row key, as a byte array.\\\\n * @throws IOException on I/O error.\\\\n */', '')", "('', '// Escaped backslash:\\n')", "('', '// Escaped byte in hexadecimal:\\n')"]
b'/**\n * Decodes a string encoded row key.\n *\n * @param encoded Encoded row key.\n * @return the row key, as a byte array.\n * @throws IOException on I/O error.\n */'public static byte[] decodeRowKey(String encoded) throws IOException { final ByteArrayOutputStream os = new ByteArrayOutputStream(); ...
@Test public void testDecodeRowKeyInvalidHex() throws Exception { try { SplitKeyFile.decodeRowKey("this is a \\x-6"); fail("An exception should have been thrown."); } catch (IOException ioe) { assertEquals("Invalid hexadecimal escape in encoded row key: 'this is a \\x-6'.", ...
["('/**\\\\n * Decodes a string encoded row key.\\\\n *\\\\n * @param encoded Encoded row key.\\\\n * @return the row key, as a byte array.\\\\n * @throws IOException on I/O error.\\\\n */', '')", "('', '// Escaped backslash:\\n')", "('', '// Escaped byte in hexadecimal:\\n')"]
b'/**\n * Decodes a string encoded row key.\n *\n * @param encoded Encoded row key.\n * @return the row key, as a byte array.\n * @throws IOException on I/O error.\n */'public static byte[] decodeRowKey(String encoded) throws IOException { final ByteArrayOutputStream os = new ByteArrayOutputStream(); ...
@Test public void testDecodeRowKeyIncompleteHex() throws Exception { try { SplitKeyFile.decodeRowKey("this is a \\x6"); fail("An exception should have been thrown."); } catch (IOException ioe) { assertEquals("Invalid hexadecimal escape in encoded row key: 'this is a \\x6'.", ...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testToString() { String uri = "kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col/"; assertEquals(uri, KijiURI.newBuilder(uri).build().toString()); uri = "kiji-hbase://zkhost1:1234/instance/table/col/"; assertEquals(uri, KijiURI.newBuilder(uri).build().toString()); uri ...
Gets the version of the Kiji client software @return The version string @throws IOException on IO error Proper release use the value of ImplementationVersion in METAINFMANIFESTMF Most likely a development version
b'/**\n * Gets the version of the Kiji client software.\n *\n * @return The version string.\n * @throws IOException on I/O error.\n */'public static String getSoftwareVersion() throws IOException { final String version = VersionInfo.class.getPackage().getImplementationVersion(); if (version != null)...
@Test public void testGetSoftwareVersion() throws Exception { // We cannot compare against any concrete value here, or else the test will fail // depending on whether this is a development version or a release... assertFalse(VersionInfo.getSoftwareVersion().isEmpty()); }
Reports the maximum system version of the Kiji instance format understood by the client p The instance format describes the layout of the global metadata state of a Kiji instance This version number specifies which Kiji instances it would be compatible with See @link isKijiVersionCompatible to determine whether a deplo...
b'/**\n * Reports the maximum system version of the Kiji instance format understood by the client.\n *\n * <p>\n * The instance format describes the layout of the global metadata state of\n * a Kiji instance. This version number specifies which Kiji instances it would\n * be compatible with. See {@lin...
@Test public void testGetClientDataVersion() { // This is the actual version we expect to be in there right now. assertEquals(Versions.MAX_SYSTEM_VERSION, VersionInfo.getClientDataVersion()); }
Gets the version of the Kiji instance format installed on the HBase cluster pThe instance format describes the layout of the global metadata state of a Kiji instancep @param systemTable An open KijiSystemTable @return A parsed version of the storage format protocol version string @throws IOException on IO error
b'/**\n * Gets the version of the Kiji instance format installed on the HBase cluster.\n *\n * <p>The instance format describes the layout of the global metadata state of\n * a Kiji instance.</p>\n *\n * @param systemTable An open KijiSystemTable.\n * @return A parsed version of the storage format protoco...
@Test public void testGetClusterDataVersion() throws Exception { final KijiSystemTable systemTable = createMock(KijiSystemTable.class); // This version number for this test was picked out of a hat. expect(systemTable.getDataVersion()).andReturn(ProtocolVersion.parse("system-1.1")).anyTimes(); f...
Validates that the client instance format version is compatible with the instance format version installed on a Kiji instance Throws IncompatibleKijiVersionException if not pFor the definition of compatibility used in this method see @link isKijiVersionCompatiblep @param kiji An open kiji instance @throws IOException o...
b'/**\n * Validates that the client instance format version is compatible with the instance\n * format version installed on a Kiji instance.\n * Throws IncompatibleKijiVersionException if not.\n *\n * <p>For the definition of compatibility used in this method, see {@link\n * #isKijiVersionCompatible}</p>\n ...
@Test public void testValidateVersion() throws Exception { final KijiSystemTable systemTable = createMock(KijiSystemTable.class); expect(systemTable.getDataVersion()).andReturn(VersionInfo.getClientDataVersion()).anyTimes(); final Kiji kiji = createMock(Kiji.class); expect(kiji.getSystemTable()...
["('/**\\\\n * Validates that the client instance format version is compatible with the instance\\\\n * format version installed on a Kiji instance.\\\\n * Throws IncompatibleKijiVersionException if not.\\\\n *\\\\n * <p>For the definition of compatibility used in this method, see {@link\\\\n * #isKijiVersi...
b'/**\n * Validates that the client instance format version is compatible with the instance\n * format version installed on a Kiji instance.\n * Throws IncompatibleKijiVersionException if not.\n *\n * <p>For the definition of compatibility used in this method, see {@link\n * #isKijiVersionCompatible}</p>\n ...
@Test public void testValidateVersionFail() throws Exception { final KijiSystemTable systemTable = createMock(KijiSystemTable.class); expect(systemTable.getDataVersion()).andReturn(ProtocolVersion.parse("kiji-0.9")).anyTimes(); final Kiji kiji = createMock(Kiji.class); expect(kiji.getSystemTabl...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testKijiVsSystemProtocol() { // New client (1.0.0-rc4 or higher) interacting with a table installed via 1.0.0-rc3. final ProtocolVersion clientVersion = ProtocolVersion.parse("system-1.0"); final ProtocolVersion clusterVersion = ProtocolVersion.parse("kiji-1.0"); assertTrue(Ve...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testOldKijiRefusesToReadNewSystemProtocol() { // The old 1.0.0-rc3 client should refuse to interop with a new instance created by // 1.0.0-rc4 or higher due to the data version protocol namespace change. Forwards // compatibility is not supported by the release candidates, even thoug...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testKijiVsNewerSystemProtocol() { // An even newer client (not yet defined as of 1.0.0-rc4) that uses a 'system-1.1' // protocol should still be compatible with a table installed via 1.0.0-rc3. // kiji-1.0 => system-1.0, and all system-1.x versions should be compatible. final Pr...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testDifferentSystemProtocols() { // In the future, when we release it, system-1.1 should be compatible with system-1.0. final ProtocolVersion clientVersion = ProtocolVersion.parse("system-1.1"); final ProtocolVersion clusterVersion = ProtocolVersion.parse("system-1.0"); assert...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testSystemProtocolName() { // A client (1.0.0-rc4 or higher) interacting with a table installed via 1.0.0-rc4. final ProtocolVersion clientVersion = ProtocolVersion.parse("system-1.0"); final ProtocolVersion clusterVersion = ProtocolVersion.parse("system-1.0"); assertTrue(Vers...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testNormalizedQuorum() { KijiURI uri = KijiURI.newBuilder("kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col/").build(); KijiURI reversedQuorumUri = KijiURI.newBuilder("kiji-hbase://(zkhost2,zkhost1):1234/instance/table/col/").build(); assertEquals(uri.toString...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testNoForwardCompatibility() { // A system-1.0-capable client should not be able to read a system-2.0 installation. final ProtocolVersion clientVersion = ProtocolVersion.parse("system-1.0"); final ProtocolVersion clusterVersion = ProtocolVersion.parse("system-2.0"); assertFals...
['("/**\\\\n * Actual comparison logic that validates client/cluster data compatibility according to\\\\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\\\\n *\\\\n * <p>package-level visibility for unit testing.</p>\\\\n *\\\\n * @param clientVersion the client software\'s instance version....
b"/**\n * Actual comparison logic that validates client/cluster data compatibility according to\n * the rules defined in {@link #isKijiVersionCompatible(Kiji)}.\n *\n * <p>package-level visibility for unit testing.</p>\n *\n * @param clientVersion the client software's instance version.\n * @param cluster...
@Test public void testBackCompatibilityThroughMajorVersions() { // A system-2.0-capable client should still be able to read a system-1.0 installation. final ProtocolVersion clientVersion = ProtocolVersion.parse("system-2.0"); final ProtocolVersion clusterVersion = ProtocolVersion.parse("system-1.0"); ...
Constructs a ZooKeeper lock object @param zookeeper ZooKeeper client @param lockDir Path of the directory node to use for the lock ZooKeeperClientretain should be the last line of the constructor
b'/**\n * Constructs a ZooKeeper lock object.\n *\n * @param zookeeper ZooKeeper client.\n * @param lockDir Path of the directory node to use for the lock.\n */'public ZooKeeperLock(ZooKeeperClient zookeeper, File lockDir) { this.mConstructorStack = CLEANUP_LOG.isDebugEnabled() ? Debug.getStackTrace() : ...
@Test public void testZooKeeperLock() throws Exception { final File lockDir = new File("/lock"); final ZooKeeperClient zkClient = ZooKeeperClient.getZooKeeperClient(getZKAddress()); try { final CyclicBarrier barrier = new CyclicBarrier(2); final ZooKeeperLock lock1 = new ZooKeeperLock(zk...
Try to recursively delete a directory in ZooKeeper If another thread modifies the directory or any children of the directory the recursive delete will fail and this method will return @code false @param zkClient connection to ZooKeeper @param path to the node to remove @return whether the delete succeeded or failed @th...
b'/**\n * Try to recursively delete a directory in ZooKeeper. If another thread modifies the directory\n * or any children of the directory, the recursive delete will fail, and this method will return\n * {@code false}.\n *\n * @param zkClient connection to ZooKeeper.\n * @param path to the node to remove.\...
@Test public void testAtomicRecursiveDelete() throws Exception { final String path = "/foo/bar/baz/faz/fooz"; mZKClient.create().creatingParentsIfNeeded().forPath(path); ZooKeeperUtils.atomicRecursiveDelete(mZKClient, "/foo"); Assert.assertNull(mZKClient.checkExists().forPath("/foo")); }
["('/**\\\\n * Try to recursively delete a directory in ZooKeeper. If another thread modifies the directory\\\\n * or any children of the directory, the recursive delete will fail, and this method will return\\\\n * {@code false}.\\\\n *\\\\n * @param zkClient connection to ZooKeeper.\\\\n * @param path to ...
b'/**\n * Try to recursively delete a directory in ZooKeeper. If another thread modifies the directory\n * or any children of the directory, the recursive delete will fail, and this method will return\n * {@code false}.\n *\n * @param zkClient connection to ZooKeeper.\n * @param path to the node to remove.\...
@Test public void testAtomicRecursiveDeleteWithPersistentENode() throws Exception { final String path = "/foo/bar/baz/faz/fooz"; PersistentEphemeralNode node = new PersistentEphemeralNode(mZKClient, Mode.EPHEMERAL, path, new byte[0]); try { node.start(); node.waitForInitialCre...
["('/**\\\\n * Build a transaction to atomically delete a directory tree. Package private for testing.\\\\n *\\\\n * @param zkClient connection to ZooKeeper.\\\\n * @param tx recursive transaction being built up.\\\\n * @param path current directory to delete.\\\\n * @return a transaction to delete the dir...
b'/**\n * Build a transaction to atomically delete a directory tree. Package private for testing.\n *\n * @param zkClient connection to ZooKeeper.\n * @param tx recursive transaction being built up.\n * @param path current directory to delete.\n * @return a transaction to delete the directory tree.\n * @...
@Test public void testAtomicRecusiveDeleteWithConcurrentNodeAddition() throws Exception { final String path = "/foo/bar/baz/faz/fooz"; mZKClient.create().creatingParentsIfNeeded().forPath(path); CuratorTransactionFinal tx = ZooKeeperUtils.buildAtomicRecursiveDelete(mZKClient, mZKClient.inTran...
["('/**\\\\n * Build a transaction to atomically delete a directory tree. Package private for testing.\\\\n *\\\\n * @param zkClient connection to ZooKeeper.\\\\n * @param tx recursive transaction being built up.\\\\n * @param path current directory to delete.\\\\n * @return a transaction to delete the dir...
b'/**\n * Build a transaction to atomically delete a directory tree. Package private for testing.\n *\n * @param zkClient connection to ZooKeeper.\n * @param tx recursive transaction being built up.\n * @param path current directory to delete.\n * @return a transaction to delete the directory tree.\n * @...
@Test public void testAtomicRecusiveDeleteWithConcurrentNodeDeletion() throws Exception { final String path = "/foo/bar/baz/faz/fooz"; mZKClient.create().creatingParentsIfNeeded().forPath(path); CuratorTransactionFinal tx = ZooKeeperUtils.buildAtomicRecursiveDelete(mZKClient, mZKClient.inTran...
['(\'/**\\\\n * Create a new ZooKeeper client for the provided ensemble. The returned client is already\\\\n * started, but the caller is responsible for closing it. The returned client *may* share an\\\\n * underlying connection, therefore this method is not suitable if closing the client must\\\\n * determini...
b'/**\n * Create a new ZooKeeper client for the provided ensemble. The returned client is already\n * started, but the caller is responsible for closing it. The returned client *may* share an\n * underlying connection, therefore this method is not suitable if closing the client must\n * deterministically close ...
@Test public void testZooKeeperConnectionsAreCached() throws Exception { final CuratorFramework other = ZooKeeperUtils.getZooKeeperClient(getZKAddress()); try { Assert.assertTrue(mZKClient.getZookeeperClient() == other.getZookeeperClient()); } finally { other.close(); } }
['(\'/**\\\\n * Create a new ZooKeeper client for the provided ensemble. The returned client is already\\\\n * started, but the caller is responsible for closing it. The returned client *may* share an\\\\n * underlying connection, therefore this method is not suitable if closing the client must\\\\n * determini...
b'/**\n * Create a new ZooKeeper client for the provided ensemble. The returned client is already\n * started, but the caller is responsible for closing it. The returned client *may* share an\n * underlying connection, therefore this method is not suitable if closing the client must\n * deterministically close ...
@Test public void testFakeURIsAreNamespaced() throws Exception { final String namespace = "testFakeURIsAreNamespaced"; final KijiURI uri = KijiURI.newBuilder("kiji://.fake." + namespace).build(); final CuratorFramework framework = ZooKeeperUtils.getZooKeeperClient(uri); try { Assert.assert...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testCassandraUriDoubleApersand() { final String uriString = "kiji-cassandra://zkhost:1234/sally@cinnamon@chost:5678"; try { final CassandraKijiURI uri = CassandraKijiURI.newBuilder(uriString).build(); fail("An exception should have been thrown."); } catch (KijiURIExcept...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testNormalizedColumns() { KijiURI uri = KijiURI.newBuilder("kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col/").build(); KijiURI reversedColumnURI = KijiURI.newBuilder("kiji-hbase://(zkhost2,zkhost1):1234/instance/table/col/").build(); assertEquals(uri.toStrin...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testCassandraUriTooManyColons() { final String uriString = "kiji-cassandra://zkhost:1234/sally:cinnamon:foo@chost:5678"; try { final CassandraKijiURI uri = CassandraKijiURI.newBuilder(uriString).build(); fail("An exception should have been thrown."); } catch (KijiURIExc...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testCassandraUriWithUsername() { final String uriString = "kiji-cassandra://zkhost:1234/sallycinnamon@chost:5678"; try { final CassandraKijiURI uri = CassandraKijiURI.newBuilder(uriString).build(); fail("An exception should have been thrown."); } catch (KijiURIException...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testNoAuthority() { try { CassandraKijiURI.newBuilder("kiji-cassandra:///"); fail("An exception should have been thrown."); } catch (KijiURIException kurie) { assertEquals("Invalid Kiji URI: 'kiji-cassandra:///' : ZooKeeper ensemble missing.", kurie.getMess...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testBrokenCassandraPort() { try { CassandraKijiURI.newBuilder("kiji-cassandra://zkhost/chost:port/default").build(); fail("An exception should have been thrown."); } catch (KijiURIException kurie) { assertEquals( "Invalid Kiji URI: 'kiji-cassandra://zkhost/...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testMultipleHostsNoParen() { try { CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost1,zkhost2:1234/chost:5678/instance/table/col"); fail("An exception should have been thrown."); } catch (KijiURIException kurie) { assertEquals( "Invalid Kiji ...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testMultipleHostsMultiplePorts() { try { CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost1:1234,zkhost2:2345/chost:5678/instance/table/col"); fail("An exception should have been thrown."); } catch (KijiURIException kurie) { assertEquals( "In...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testExtraPath() { try { CassandraKijiURI.newBuilder( "kiji-cassandra://(zkhost1,zkhost2):1234/chost:5678/instance/table/col/extra"); fail("An exception should have been thrown."); } catch (KijiURIException kurie) { assertEquals( "Invalid Kiji URI...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testToString() { String uri = "kiji-cassandra://(zkhost1,zkhost2):1234/chost:5678/instance/table/col/"; assertEquals(uri, CassandraKijiURI.newBuilder(uri).build().toString()); uri = "kiji-cassandra://zkhost1:1234/chost:5678/instance/table/col/"; assertEquals(uri, CassandraKijiUR...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testNormalizedQuorum() { CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://(zkhost1,zkhost2):1234/chost:5678/instance/table/col/").build(); CassandraKijiURI reversedQuorumUri = CassandraKijiURI.newBuilder( "kiji-cassandra://(zkhost2,zkhost1):1234/chos...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testNormalizedColumns() { CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://(zkhost1,zkhost2):1234/chost:5678/instance/table/col/").build(); CassandraKijiURI reversedColumnURI = CassandraKijiURI.newBuilder( "kiji-cassandra://(zkhost2,zkhost1):1234/cho...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testKijiURIBuilderDefault() { KijiURI uri = KijiURI.newBuilder().build(); assertTrue(!uri.getZookeeperQuorum().isEmpty()); // Test cannot be more specific. // Test cannot validate the value of uri.getZookeeperClientPort(). assertEquals(KConstants.DEFAULT_INSTANCE_NAME, uri.getI...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testOrderedCassandraNodes() { String revString = "kiji-cassandra://zkhost:1234/(chost2,chost1):5678/instance/table/col/"; String ordString = "kiji-cassandra://zkhost:1234/(chost1,chost2):5678/instance/table/col/"; CassandraKijiURI revUri = CassandraKijiURI.newBuilder(revString).bui...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testCassandraKijiURIBuilderDefault() { CassandraKijiURI uri = CassandraKijiURI.newBuilder().build(); assertTrue(!uri.getZookeeperQuorum().isEmpty()); // Test cannot be more specific. // Test cannot validate the value of uri.getZookeeperClientPort(). assertEquals(KConstants.DEFA...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testCassandraKijiURIBuilderFromInstance() { final CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost:1234/chost:5678/.unset/table").build(); CassandraKijiURI built = CassandraKijiURI.newBuilder(uri).build(); assertEquals(uri, built); }
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testCassandraKijiURIBuilderWithInstance() { final CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost:1234/chost:5678/instance1/table").build(); assertEquals("instance1", uri.getInstance()); final CassandraKijiURI modified = CassandraKijiURI...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testSetColumn() { CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost/chost:5678/instance/table/").build(); assertTrue(uri.getColumns().isEmpty()); uri = CassandraKijiURI.newBuilder(uri).withColumnNames(Arrays.asList("testcol1", "testcol2"))...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testSetZookeeperQuorum() { final CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost/chost:5678/instance/table/col").build(); final CassandraKijiURI modified = CassandraKijiURI.newBuilder(uri) .withZookeeperQuorum(new String[] {"zkhost1", "zkhost...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testTrailingUnset() { final CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost/chost:5678/.unset/table/.unset").build(); CassandraKijiURI result = CassandraKijiURI.newBuilder(uri).withTableName(".unset").build(); assertEquals("kiji-cassandra://zkhos...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testEscapedMapColumnQualifier() { final CassandraKijiURI uri = CassandraKijiURI.newBuilder( "kiji-cassandra://zkhost/chost:5678/instance/table/map:one%20two").build(); assertEquals("map:one two", uri.getColumns().get(0).getName()); }
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testConstructedUriIsEscaped() { // SCHEMA-6. Column qualifier must be URL-encoded in CassandraKijiURI. final CassandraKijiURI uri = CassandraKijiURI.newBuilder("kiji-cassandra://zkhost/chost:5678/instance/table/") .addColumnName(new KijiColumnName("map:one two")).build()...
["('/**\\\\n * Create a new {@link KijiResult} backed by Cassandra.\\\\n *\\\\n * @param entityId EntityId of the row from which to read cells.\\\\n * @param dataRequest KijiDataRequest defining the values to retrieve.\\\\n * @param table The table being viewed.\\\\n * @param layout The layout of the table....
b'/**\n * Create a new {@link KijiResult} backed by Cassandra.\n *\n * @param entityId EntityId of the row from which to read cells.\n * @param dataRequest KijiDataRequest defining the values to retrieve.\n * @param table The table being viewed.\n * @param layout The layout of the table.\n * @param column...
@Test public void testGetFullyQualifiedColumn() throws Exception { for (KijiColumnName column : ImmutableList.of(PRIMITIVE_STRING, STRING_MAP_1)) { for (int pageSize : ImmutableList.of(0, 1, 2, 10)) { { // Single version | no timerange final KijiDataRequest request = KijiDataRequest ...
["('/** {@inheritDoc} */', '')", "('', '// In the case that we have enough information to generate a prefix, we will\\n')", '(\'\', "// construct a PrefixFilter that is AND\'ed with the RowFilter. This way,\\n")', "('', '// when the scan passes the end of the prefix, it can end the filtering\\n')", "('', '// process q...
b'/** {@inheritDoc} */'@Override public Filter toHBaseFilter(Context context) throws IOException { // In the case that we have enough information to generate a prefix, we will // construct a PrefixFilter that is AND'ed with the RowFilter. This way, // when the scan passes the end of the prefix, it ca...
@Test public void testPrefixFilterHaltsFiltering() throws Exception { RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, INTEGER, LONG, LONG); EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat); FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, 100, null, 9000L); Filt...
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>K...
b'/**\n * Gets a builder configured with default Kiji URI fields.\n *\n * More precisely, the following defaults are initialized:\n * <ul>\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INS...
@Test public void testKijiURIBuilderFromInstance() { final KijiURI uri = KijiURI.newBuilder("kiji-hbase://zkhost:1234/.unset/table").build(); KijiURI built = KijiURI.newBuilder(uri).build(); assertEquals(uri, built); }
["('/**\\\\n * Create a new {@link KijiResult} backed by Cassandra.\\\\n *\\\\n * @param entityId EntityId of the row from which to read cells.\\\\n * @param dataRequest KijiDataRequest defining the values to retrieve.\\\\n * @param table The table being viewed.\\\\n * @param layout The layout of the table....
b'/**\n * Create a new {@link KijiResult} backed by Cassandra.\n *\n * @param entityId EntityId of the row from which to read cells.\n * @param dataRequest KijiDataRequest defining the values to retrieve.\n * @param table The table being viewed.\n * @param layout The layout of the table.\n * @param column...
@Test public void testGetMultipleFullyQualifiedColumns() throws Exception { final KijiColumnName column1 = PRIMITIVE_STRING; final KijiColumnName column2 = STRING_MAP_1; for (int pageSize : ImmutableList.of(0, 1, 2, 10)) { { // Single version | no timerange final KijiDataRequest re...
["('/**\\\\n * Create a new {@link KijiResult} backed by Cassandra.\\\\n *\\\\n * @param entityId EntityId of the row from which to read cells.\\\\n * @param dataRequest KijiDataRequest defining the values to retrieve.\\\\n * @param table The table being viewed.\\\\n * @param layout The layout of the table....
b'/**\n * Create a new {@link KijiResult} backed by Cassandra.\n *\n * @param entityId EntityId of the row from which to read cells.\n * @param dataRequest KijiDataRequest defining the values to retrieve.\n * @param table The table being viewed.\n * @param layout The layout of the table.\n * @param column...
@Test public void testGetFamilyColumn() throws Exception { final Map<String, ? extends List<KijiColumnName>> families = ImmutableMap.of( PRIMITIVE_FAMILY, ImmutableList.of(PRIMITIVE_DOUBLE, PRIMITIVE_STRING), STRING_MAP_FAMILY, ImmutableList.of(STRING_MAP_1, STRING_MAP_2)); ...
["('/**\\\\n * Create a new {@link KijiResult} backed by Cassandra.\\\\n *\\\\n * @param entityId EntityId of the row from which to read cells.\\\\n * @param dataRequest KijiDataRequest defining the values to retrieve.\\\\n * @param table The table being viewed.\\\\n * @param layout The layout of the table....
b'/**\n * Create a new {@link KijiResult} backed by Cassandra.\n *\n * @param entityId EntityId of the row from which to read cells.\n * @param dataRequest KijiDataRequest defining the values to retrieve.\n * @param table The table being viewed.\n * @param layout The layout of the table.\n * @param column...
@Test public void testGetMultipleFamilyColumns() throws Exception { final KijiColumnName familyColumn1 = KijiColumnName.create(PRIMITIVE_FAMILY, null); final KijiColumnName familyColumn2 = KijiColumnName.create(STRING_MAP_FAMILY, null); final KijiColumnName column1 = PRIMITIVE_DOUBLE; final Kij...
["('/**\\\\n * Create a new {@link KijiResult} backed by Cassandra.\\\\n *\\\\n * @param entityId EntityId of the row from which to read cells.\\\\n * @param dataRequest KijiDataRequest defining the values to retrieve.\\\\n * @param table The table being viewed.\\\\n * @param layout The layout of the table....
b'/**\n * Create a new {@link KijiResult} backed by Cassandra.\n *\n * @param entityId EntityId of the row from which to read cells.\n * @param dataRequest KijiDataRequest defining the values to retrieve.\n * @param table The table being viewed.\n * @param layout The layout of the table.\n * @param column...
@Test public void testNarrowView() throws Exception { final KijiColumnName familyColumn1 = KijiColumnName.create(PRIMITIVE_FAMILY, null); final KijiColumnName familyColumn2 = KijiColumnName.create(STRING_MAP_FAMILY, null); final KijiColumnName column1 = PRIMITIVE_DOUBLE; final KijiColumnName co...
["('/**\\\\n * Create a new {@link KijiResult} backed by Cassandra.\\\\n *\\\\n * @param entityId EntityId of the row from which to read cells.\\\\n * @param dataRequest KijiDataRequest defining the values to retrieve.\\\\n * @param table The table being viewed.\\\\n * @param layout The layout of the table....
b'/**\n * Create a new {@link KijiResult} backed by Cassandra.\n *\n * @param entityId EntityId of the row from which to read cells.\n * @param dataRequest KijiDataRequest defining the values to retrieve.\n * @param table The table being viewed.\n * @param layout The layout of the table.\n * @param column...
@Test(expected = UnsupportedOperationException.class) public void testGetWithFilters() throws Exception { final KijiColumnName column2 = STRING_MAP_1; final KijiDataRequest request = KijiDataRequest .builder() .addColumns( ColumnsDef.create() .withFilter( ...