description stringlengths 11 2.86k | focal_method stringlengths 70 6.25k | test_case stringlengths 96 15.3k |
|---|---|---|
["('/**\\\\n * Return a builder for columns associated with this KijiDataRequestBuilder.\\\\n *\\\\n * <p>Creates an object that allows you to specify a set of related columns attached\\\\n * to the same KijiDataRequest that all share the same retrieval properties, like\\\\n * the number of max versions.</p>\... | b'/**\n * Return a builder for columns associated with this KijiDataRequestBuilder.\n *\n * <p>Creates an object that allows you to specify a set of related columns attached\n * to the same KijiDataRequest that all share the same retrieval properties, like\n * the number of max versions.</p>\n *\n * @retu... | @Test
public void testNoNegativePageSize() {
KijiDataRequestBuilder builder = KijiDataRequest.builder();
try {
builder.newColumnsDef().withPageSize(-5).addFamily("info");
fail("An exception should have been thrown.");
} catch (IllegalArgumentException iae) {
assertEquals("Page siz... |
["('/**\\\\n * Return a builder for columns associated with this KijiDataRequestBuilder.\\\\n *\\\\n * <p>Creates an object that allows you to specify a set of related columns attached\\\\n * to the same KijiDataRequest that all share the same retrieval properties, like\\\\n * the number of max versions.</p>\... | b'/**\n * Return a builder for columns associated with this KijiDataRequestBuilder.\n *\n * <p>Creates an object that allows you to specify a set of related columns attached\n * to the same KijiDataRequest that all share the same retrieval properties, like\n * the number of max versions.</p>\n *\n * @retu... | @Test
public void testNoZeroMaxVersions() {
KijiDataRequestBuilder builder = KijiDataRequest.builder();
try {
builder.newColumnsDef().withMaxVersions(0).addFamily("info");
fail("An exception should have been thrown.");
} catch (IllegalArgumentException iae) {
assertEquals("Maximum... |
["('/**\\\\n * Construct a new KijiDataRequest based on the configuration specified in this builder\\\\n * and its associated column builders.\\\\n *\\\\n * <p>After calling build(), you may not use the builder anymore.</p>\\\\n *\\\\n * @return a new KijiDataRequest object containing the column requests as... | b'/**\n * Construct a new KijiDataRequest based on the configuration specified in this builder\n * and its associated column builders.\n *\n * <p>After calling build(), you may not use the builder anymore.</p>\n *\n * @return a new KijiDataRequest object containing the column requests associated\n * w... | @Test
public void testEmptyOk() {
assertNotNull(KijiDataRequest.builder().build());
} |
["('/**\\\\n * Return a builder for columns associated with this KijiDataRequestBuilder.\\\\n *\\\\n * <p>Creates an object that allows you to specify a set of related columns attached\\\\n * to the same KijiDataRequest that all share the same retrieval properties, like\\\\n * the number of max versions.</p>\... | b'/**\n * Return a builder for columns associated with this KijiDataRequestBuilder.\n *\n * <p>Creates an object that allows you to specify a set of related columns attached\n * to the same KijiDataRequest that all share the same retrieval properties, like\n * the number of max versions.</p>\n *\n * @retu... | @Test
public void testNoSettingMaxVerTwice() {
KijiDataRequestBuilder builder = KijiDataRequest.builder();
try {
builder.newColumnsDef().withMaxVersions(2).withMaxVersions(3).addFamily("info");
fail("An exception should have been thrown.");
} catch (IllegalStateException ise) {
as... |
["('/**\\\\n * Return a builder for columns associated with this KijiDataRequestBuilder.\\\\n *\\\\n * <p>Creates an object that allows you to specify a set of related columns attached\\\\n * to the same KijiDataRequest that all share the same retrieval properties, like\\\\n * the number of max versions.</p>\... | b'/**\n * Return a builder for columns associated with this KijiDataRequestBuilder.\n *\n * <p>Creates an object that allows you to specify a set of related columns attached\n * to the same KijiDataRequest that all share the same retrieval properties, like\n * the number of max versions.</p>\n *\n * @retu... | @Test
public void testNoSettingPageSizeTwice() {
KijiDataRequestBuilder builder = KijiDataRequest.builder();
try {
builder.newColumnsDef().withPageSize(2).withPageSize(3).addFamily("info");
fail("An exception should have been thrown.");
} catch (IllegalStateException ise) {
assert... |
["('/**\\\\n * Sets the time range of cells to return: [<code>minTimestamp</code>,\\\\n * <code>maxTimestamp</code>).\\\\n *\\\\n * @param minTimestamp Request cells with a timestamp at least minTimestamp.\\\\n * @param maxTimestamp Request cells with a timestamp less than maxTimestamp.\\\\n * @return This ... | b'/**\n * Sets the time range of cells to return: [<code>minTimestamp</code>,\n * <code>maxTimestamp</code>).\n *\n * @param minTimestamp Request cells with a timestamp at least minTimestamp.\n * @param maxTimestamp Request cells with a timestamp less than maxTimestamp.\n * @return This data request builder... | @Test
public void testNoSettingTimeRangeTwice() {
KijiDataRequestBuilder builder = KijiDataRequest.builder();
try {
builder.withTimeRange(2, 3).withTimeRange(6, 9);
fail("An exception should have been thrown.");
} catch (IllegalStateException ise) {
assertEquals("Cannot set time r... |
["('/**\\\\n * Return a builder for columns associated with this KijiDataRequestBuilder.\\\\n *\\\\n * <p>Creates an object that allows you to specify a set of related columns attached\\\\n * to the same KijiDataRequest that all share the same retrieval properties, like\\\\n * the number of max versions.</p>\... | b'/**\n * Return a builder for columns associated with this KijiDataRequestBuilder.\n *\n * <p>Creates an object that allows you to specify a set of related columns attached\n * to the same KijiDataRequest that all share the same retrieval properties, like\n * the number of max versions.</p>\n *\n * @retu... | @Test
public void testNoPropertiesAfterAdd() {
KijiDataRequestBuilder builder = KijiDataRequest.builder();
try {
builder.newColumnsDef().add("info", "foo").withMaxVersions(5);
fail("An exception should have been thrown.");
} catch (IllegalStateException ise) {
assertEquals(
... |
['(\'/**\\\\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 testSingleHostDefaultPort() {
final KijiURI uri = KijiURI.newBuilder("kiji-hbase://zkhost/instance/table/col").build();
assertEquals("kiji-hbase", uri.getScheme());
assertEquals(1, uri.getZookeeperQuorum().size());
assertEquals("zkhost", uri.getZookeeperQuorum().get(0));
as... |
Validates a data request against this validators table layout @param dataRequest The KijiDataRequest to validate @throws KijiDataRequestException If the data request is invalid | b"/**\n * Validates a data request against this validator's table layout.\n *\n * @param dataRequest The KijiDataRequest to validate.\n * @throws KijiDataRequestException If the data request is invalid.\n */"public void validate(KijiDataRequest dataRequest) {
for (KijiDataRequest.Column column : dataRequ... | @Test
public void testValidate() throws InvalidLayoutException {
KijiDataRequestBuilder builder = KijiDataRequest.builder().withTimeRange(2, 3);
builder.newColumnsDef().withMaxVersions(1).add("info", "name");
KijiDataRequest request = builder.build();
mValidator.validate(request);
} |
['("/**\\\\n * Validates a data request against this validator\'s table layout.\\\\n *\\\\n * @param dataRequest The KijiDataRequest to validate.\\\\n * @throws KijiDataRequestException If the data request is invalid.\\\\n */", \'\')'] | b"/**\n * Validates a data request against this validator's table layout.\n *\n * @param dataRequest The KijiDataRequest to validate.\n * @throws KijiDataRequestException If the data request is invalid.\n */"public void validate(KijiDataRequest dataRequest) {
for (KijiDataRequest.Column column : dataRequ... | @Test
public void testValidateNoSuchFamily() throws InvalidLayoutException {
KijiDataRequestBuilder builder = KijiDataRequest.builder().withTimeRange(2, 3);
builder.newColumnsDef().withMaxVersions(1).add("blahblah", "name");
KijiDataRequest request = builder.build();
try {
mValidator.val... |
['("/**\\\\n * Validates a data request against this validator\'s table layout.\\\\n *\\\\n * @param dataRequest The KijiDataRequest to validate.\\\\n * @throws KijiDataRequestException If the data request is invalid.\\\\n */", \'\')'] | b"/**\n * Validates a data request against this validator's table layout.\n *\n * @param dataRequest The KijiDataRequest to validate.\n * @throws KijiDataRequestException If the data request is invalid.\n */"public void validate(KijiDataRequest dataRequest) {
for (KijiDataRequest.Column column : dataRequ... | @Test
public void testValidateNoSuchColumn() throws InvalidLayoutException {
KijiDataRequestBuilder builder = KijiDataRequest.builder().withTimeRange(2, 3);
builder.newColumnsDef().withMaxVersions(1)
.add("info", "name")
.add("info", "blahblah");
KijiDataRequest request = builder.bui... |
@inheritDoc | b'/** {@inheritDoc} */'@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!getClass().equals(obj.getClass())) {
return false;
}
final KijiRowKeyComponents krkc = (KijiRowKeyComponents)obj;
return Arrays.deepEquals(mComponents, krkc.mComp... | @Test
public void testEquals() throws Exception {
KijiRowKeyComponents krkc1 = KijiRowKeyComponents.fromComponents(
"jennyanydots",
1,
null,
null);
KijiRowKeyComponents krkc2 = KijiRowKeyComponents.fromComponents(
"jennyanydots",
1,
null,
... |
@inheritDoc | b'/** {@inheritDoc} */'@Override
public int hashCode() {
return Arrays.deepHashCode(mComponents);
} | @Test
public void testHashCode() throws Exception {
byte[] bytes1 = new byte[]{47};
byte[] bytes2 = new byte[]{47};
assertFalse(bytes1.equals(bytes2));
KijiRowKeyComponents krkc1 = KijiRowKeyComponents.fromComponents(bytes1);
KijiRowKeyComponents krkc2 = KijiRowKeyComponents.fromComponents(b... |
["('/**\\\\n * Creates a KijiRowKeyComponents from components.\\\\n *\\\\n * @param components the components of the row key.\\\\n * @return a KijiRowKeyComponents\\\\n */', '')", "('', '// Some of these checks will be redundant when the KijiRowKeyComponents is converted\\n')", "('', '// into an EntityId, but... | b'/**\n * Creates a KijiRowKeyComponents from components.\n *\n * @param components the components of the row key.\n * @return a KijiRowKeyComponents\n */'public static KijiRowKeyComponents fromComponents(Object... components) {
Preconditions.checkNotNull(components);
Preconditions.checkArgument(com... | @Test
public void testFormattedCompare() {
List<KijiRowKeyComponents> sorted = ImmutableList.of(
KijiRowKeyComponents.fromComponents("a", null, null),
KijiRowKeyComponents.fromComponents("a", 123, 456L),
KijiRowKeyComponents.fromComponents("a", 456, null));
List<KijiRowKeyCompo... |
["('/**\\\\n * Creates a KijiRowKeyComponents from components.\\\\n *\\\\n * @param components the components of the row key.\\\\n * @return a KijiRowKeyComponents\\\\n */', '')", "('', '// Some of these checks will be redundant when the KijiRowKeyComponents is converted\\n')", "('', '// into an EntityId, but... | b'/**\n * Creates a KijiRowKeyComponents from components.\n *\n * @param components the components of the row key.\n * @return a KijiRowKeyComponents\n */'public static KijiRowKeyComponents fromComponents(Object... components) {
Preconditions.checkNotNull(components);
Preconditions.checkArgument(com... | @Test
public void testRawCompare() {
final List<KijiRowKeyComponents> sorted = ImmutableList.of(
KijiRowKeyComponents.fromComponents(new Object[] {new byte[] {0x00, 0x00}}),
KijiRowKeyComponents.fromComponents(new Object[] {new byte[] {0x00, 0x01}}),
KijiRowKeyComponents.fromComponent... |
Resolution in number of bytes when generating evenly spaced HBase row keys @return the number of bytes required by an md5 hash | b'/**\n * Resolution (in number of bytes) when generating evenly spaced HBase row keys.\n *\n * @return the number of bytes required by an md5 hash.\n */'@Deprecated
public int getRowKeyResolution() {
return 16;
} | @Test
public void testGetRowKeyResolution() throws IOException {
assertEquals(2, KijiRowKeySplitter
.getRowKeyResolution(KijiTableLayouts.getLayout(KijiTableLayouts.FORMATTED_RKF)));
assertEquals(16, KijiRowKeySplitter
.getRowKeyResolution(KijiTableLayouts.getLayout(KijiTableLayouts.FULL_... |
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\\\\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... | b'/**\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\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... | @Test
public void testIllegalScheme() {
try {
KijiURI.newBuilder("kiji-foo:///");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertTrue(kurie.getMessage().contains("No parser available for"));
}
} |
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\\\\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... | b'/**\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\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... | @Test
public void testNoAuthority() {
try {
KijiURI.newBuilder("kiji:///");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji:///' : ZooKeeper ensemble missing.",
kurie.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 testMultipleHosts() {
final KijiURI uri =
KijiURI.newBuilder("kiji-hbase://(zkhost1,zkhost2):1234/instance/table/col").build();
assertEquals("kiji-hbase", uri.getScheme());
assertEquals("zkhost1", uri.getZookeeperQuorum().get(0));
assertEquals("zkhost2", uri.getZookeepe... |
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\\\\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... | b'/**\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\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... | @Test
public void testMultipleHostsNoParen() {
try {
KijiURI.newBuilder("kiji://zkhost1,zkhost2:1234/instance/table/col");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji://zkhost1,zkhost2:1234/instance/table/col' ... |
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\\\\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... | b'/**\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\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... | @Test
public void testMultipleHostsMultiplePorts() {
try {
KijiURI.newBuilder("kiji://zkhost1:1234,zkhost2:2345/instance/table/col");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji://zkhost1:1234,zkhost2:2345/inst... |
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\\\\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... | b'/**\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\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... | @Test
public void testExtraPath() {
try {
KijiURI.newBuilder("kiji://(zkhost1,zkhost2):1234/instance/table/col/extra");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji://(zkhost1,zkhost2):1234/instance/table/col/ex... |
@inheritDoc | b'/** {@inheritDoc} */'@Override
public String toString() {
return toString(false);
} | @Test
public void testToString() {
String uri = "kiji://(zkhost1,zkhost2):1234/instance/table/col/";
assertEquals(uri, KijiURI.newBuilder(uri).build().toString());
uri = "kiji://zkhost1:1234/instance/table/col/";
assertEquals(uri, KijiURI.newBuilder(uri).build().toString());
uri = "kiji://zk... |
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\\\\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... | b'/**\n * Gets a builder configured with default Kiji URI fields for an HBase cluster.\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... | @Test
public void testKijiURIBuilderFromInstance() {
final KijiURI uri = KijiURI.newBuilder("kiji://zkhost:1234/.unset/table").build();
KijiURI built = KijiURI.newBuilder(uri).build();
assertEquals(uri, built);
} |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public void close() throws IOException {
mQualifierPager.close();
} | @Test
public void testQualifiersIterator() throws IOException {
final EntityId eid = mTable.getEntityId("me");
final KijiDataRequest dataRequest = KijiDataRequest.builder()
.addColumns(ColumnsDef.create()
.withMaxVersions(HConstants.ALL_VERSIONS).withPageSize(1).addFamily("jobs"))
... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public void close() throws IOException {
mQualifierIterator.close();
if (mVersionIterator != null) {
mVersionIterator.close();
}
} | @Test
public void testQualifiersIterator() throws IOException {
final EntityId eid = mTable.getEntityId("me");
final KijiDataRequest dataRequest = KijiDataRequest.builder()
.addColumns(ColumnsDef.create()
.withMaxVersions(HConstants.ALL_VERSIONS).withPageSize(1).addFamily("jobs"))
... |
Creates a raw entity ID @param rowKey KijiHBase row key both row keys are identical | b'/**\n * Creates a raw entity ID.\n *\n * @param rowKey Kiji/HBase row key (both row keys are identical).\n */'private RawEntityId(byte[] rowKey) {
mBytes = Preconditions.checkNotNull(rowKey);
} | @Test
public void testRawEntityId() {
final byte[] bytes = new byte[] {0x11, 0x22};
final RawEntityId eid = RawEntityId.getEntityId(bytes);
assertArrayEquals(bytes, (byte[])eid.getComponentByIndex(0));
assertArrayEquals(bytes, eid.getHBaseRowKey());
assertEquals(1, eid.getComponents().size()... |
Loads the dictionary from a file @param filename The path to a file of words one per line @return The list of words from the file @throws IOException If there is an error reading the words from the file | b'/**\n * Loads the dictionary from a file.\n *\n * @param filename The path to a file of words, one per line.\n * @return The list of words from the file.\n * @throws IOException If there is an error reading the words from the file.\n */'public List<String> load(String filename) throws IOException {
F... | @Test
public void testLoad() throws IOException {
DictionaryLoader loader = new DictionaryLoader();
List<String> dictionary = loader.load(getClass().getClassLoader().getResourceAsStream(
"org/kiji/schema/tools/synth/dictionary.txt"));
assertEquals(3, dictionary.size());
assertEquals(... |
['(\'/**\\\\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 testMultipleHostsDefaultPort() {
final KijiURI uri =
KijiURI.newBuilder("kiji-hbase://zkhost1,zkhost2/instance/table/col").build();
assertEquals("kiji-hbase", uri.getScheme());
assertEquals("zkhost1", uri.getZookeeperQuorum().get(0));
assertEquals("zkhost2", uri.getZook... |
Construct an email address string @param username The part before the @ symbol @param domain The part after the @ symbol @return An email address ltusernamegt@ltdomaingt | b"/**\n * Construct an email address string.\n *\n * @param username The part before the '@' symbol.\n * @param domain The part after the '@' symbol.\n * @return An email address (<username>@<domain>).\n */"public static String formatEmail(String username, String domain) {
return username +... | @Test
public void testFormatEmail() {
assertEquals("a@b.com", EmailSynthesizer.formatEmail("a", "b.com"));
} |
["('', '// Pick n words from the dictionary.\\n')"] | @Override
public String synthesize() {
// Pick n words from the dictionary.
List<String> grams = new ArrayList<String>(mN);
for (int i = 0; i < mN; i++) {
grams.add(mWordSynthesizer.synthesize());
}
return StringUtils.join(grams, " ");
} | @Test
public void testWordSynth() {
WordSynthesizer wordSynthesizer = createStrictMock(WordSynthesizer.class);
expect(wordSynthesizer.synthesize()).andReturn("a");
expect(wordSynthesizer.synthesize()).andReturn("b");
expect(wordSynthesizer.synthesize()).andReturn("c");
expect(wordSynthesizer... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "create-table";
} | @Test
public void testCreateHashedTableWithNumRegions() throws Exception {
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FOO_TEST);
final File layoutFile = getTempLayoutFile(layout);
final KijiURI tableURI =
KijiURI.newBuilder(getKiji().getURI()).withTableNam... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "create-table";
} | @Test
public void testCreateUnhashedTableWithSplitKeys() throws Exception {
final KijiTableLayout layout =
KijiTableLayout.newLayout(KijiTableLayouts.getFooUnhashedTestLayout());
final File layoutFile = getTempLayoutFile(layout);
final KijiURI tableURI =
KijiURI.newBuilder(getKiji().... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "create-table";
} | @Test
public void testCreateHashedTableWithSplitKeys() throws Exception {
final KijiTableLayout layout =
KijiTableLayouts.getTableLayout(KijiTableLayouts.FOO_TEST_LEGACY);
final File layoutFile = getTempLayoutFile(layout);
final KijiURI tableURI =
KijiURI.newBuilder(getKiji().getURI(... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "create-table";
} | @Test
public void testCreateUnhashedTableWithNumRegions() throws Exception {
final KijiTableLayout layout =
KijiTableLayout.newLayout(KijiTableLayouts.getFooUnhashedTestLayout());
final File layoutFile = getTempLayoutFile(layout);
final KijiURI tableURI =
KijiURI.newBuilder(getKiji()... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "create-table";
} | @Test
public void testCreateTableWithInvalidSchemaClassInLayout() throws Exception {
final TableLayoutDesc layout = KijiTableLayouts.getLayout(KijiTableLayouts.INVALID_SCHEMA);
final File layoutFile = getTempLayoutFile(layout);
final KijiURI tableURI =
KijiURI.newBuilder(getKiji().getURI()).w... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "get";
} | @Test
public void testGetFromTable() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.SIMPLE);
kiji.createTable(layout.getName(), layout);
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "get";
} | @Test
public void testGetFromTableMore() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FOO_TEST);
final long timestamp = 10L;
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.wit... |
['(\'/**\\\\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 testMultipleHostsDefaultPortDefaultInstance() {
final KijiURI uri =
KijiURI.newBuilder("kiji-hbase://zkhost1,zkhost2/default/table/col").build();
assertEquals("kiji-hbase", uri.getScheme());
assertEquals("zkhost1", uri.getZookeeperQuorum().get(0));
assertEquals("zkhost2... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "get";
} | @Test
public void testGetFormattedRKF() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FORMATTED_RKF);
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.withRow("NYC", "Technology", "wi... |
['("/**\\\\n * Return the tool specified by the \'toolName\' argument.\\\\n * (package-protected for use by the HelpTool, and for testing.)\\\\n *\\\\n * @param toolName the name of the tool to instantiate.\\\\n * @return the KijiTool that provides for that name, or null if none does.\\\\n */", \'\')', "(''... | b"/**\n * Return the tool specified by the 'toolName' argument.\n * (package-protected for use by the HelpTool, and for testing.)\n *\n * @param toolName the name of the tool to instantiate.\n * @return the KijiTool that provides for that name, or null if none does.\n */"KijiTool getToolForName(String toolN... | @Test
public void testGetToolName() {
KijiTool tool = new KijiToolLauncher().getToolForName("ls");
assertNotNull("Got a null tool back, should have gotten a real one.", tool);
assertEquals("Tool does not advertise it responds to 'ls'.", "ls", tool.getName());
assertTrue("Didn't get the LsTool we ... |
['("/**\\\\n * Return the tool specified by the \'toolName\' argument.\\\\n * (package-protected for use by the HelpTool, and for testing.)\\\\n *\\\\n * @param toolName the name of the tool to instantiate.\\\\n * @return the KijiTool that provides for that name, or null if none does.\\\\n */", \'\')', "(''... | b"/**\n * Return the tool specified by the 'toolName' argument.\n * (package-protected for use by the HelpTool, and for testing.)\n *\n * @param toolName the name of the tool to instantiate.\n * @return the KijiTool that provides for that name, or null if none does.\n */"KijiTool getToolForName(String toolN... | @Test
public void testGetMissingTool() {
KijiTool tool = new KijiToolLauncher().getToolForName("this-tool/can't1`exist");
assertNull(tool);
} |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "layout";
} | @Test
public void testChangeRowKeyHashing() throws Exception {
final KijiTableLayout layout =
KijiTableLayouts.getTableLayout(KijiTableLayouts.FOO_TEST_LEGACY);
getKiji().createTable(layout.getDesc());
final File newLayoutFile = getTempLayoutFile(KijiTableLayouts.getFooChangeHashingTest... |
Parses a table name for a kiji instance name @param kijiTableName The table name to parse @return instance name or null if none found | b'/**\n * Parses a table name for a kiji instance name.\n *\n * @param kijiTableName The table name to parse\n * @return instance name (or null if none found)\n */'protected static String parseInstanceName(String kijiTableName) {
final String[] parts = StringUtils.split(kijiTableName, '\u0000', '.');
... | @Test
public void testParseInstanceName() {
assertEquals("default", LsTool.parseInstanceName("kiji.default.meta"));
assertEquals("default", LsTool.parseInstanceName("kiji.default.schema_hash"));
assertEquals("default", LsTool.parseInstanceName("kiji.default.schema_id"));
assertEquals("default", L... |
["('/**\\\\n * Parses a table name for a kiji instance name.\\\\n *\\\\n * @param kijiTableName The table name to parse\\\\n * @return instance name (or null if none found)\\\\n */', '')"] | b'/**\n * Parses a table name for a kiji instance name.\n *\n * @param kijiTableName The table name to parse\n * @return instance name (or null if none found)\n */'protected static String parseInstanceName(String kijiTableName) {
final String[] parts = StringUtils.split(kijiTableName, '\u0000', '.');
... | @Test
public void testParseNonKijiTable() {
String tableName = "hbase_table";
assertEquals(null, LsTool.parseInstanceName(tableName));
} |
["('/**\\\\n * Parses a table name for a kiji instance name.\\\\n *\\\\n * @param kijiTableName The table name to parse\\\\n * @return instance name (or null if none found)\\\\n */', '')"] | b'/**\n * Parses a table name for a kiji instance name.\n *\n * @param kijiTableName The table name to parse\n * @return instance name (or null if none found)\n */'protected static String parseInstanceName(String kijiTableName) {
final String[] parts = StringUtils.split(kijiTableName, '\u0000', '.');
... | @Test
public void testParseMalformedKijiTableName() {
assertEquals(null, LsTool.parseInstanceName("kiji.default"));
assertEquals(null, LsTool.parseInstanceName("kiji."));
assertEquals(null, LsTool.parseInstanceName("kiji"));
} |
Lists all kiji instances @param hbaseURI URI of the HBase instance to list the content of @return A program exit code zero on success @throws IOException If there is an error | b'/**\n * Lists all kiji instances.\n *\n * @param hbaseURI URI of the HBase instance to list the content of.\n * @return A program exit code (zero on success).\n * @throws IOException If there is an error.\n */'private int listInstances(KijiURI hbaseURI) throws IOException {
for (String instanceName :... | @Test
public void testListInstances() throws Exception {
final Kiji kiji = getKiji();
final KijiURI hbaseURI = KijiURI.newBuilder(kiji.getURI()).withInstanceName(null).build();
final LsTool ls = new LsTool();
assertEquals(BaseTool.SUCCESS, runTool(ls, hbaseURI.toString()));
final Set<Strin... |
Lists all the tables in a kiji instance @param kiji Kiji instance to list the tables of @return A program exit code zero on success @throws IOException If there is an error | b'/**\n * Lists all the tables in a kiji instance.\n *\n * @param kiji Kiji instance to list the tables of.\n * @return A program exit code (zero on success).\n * @throws IOException If there is an error.\n */'private int listTables(Kiji kiji) throws IOException {
for (String name : kiji.getTableNames(... | @Test
public void testListTables() throws Exception {
final Kiji kiji = getKiji();
assertEquals(BaseTool.SUCCESS, runTool(new LsTool(), kiji.getURI().toString()));
assertEquals(1, mToolOutputLines.length);
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.SIMPLE)... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "ls";
} | @Test
public void testTableColumns() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.SIMPLE);
kiji.createTable(layout.getDesc());
final KijiTable table = kiji.openTable(layout.getName());
try {
// Table is... |
['(\'/**\\\\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 testIllegalScheme() {
try {
KijiURI.newBuilder("kiji-foo:///");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertTrue(kurie.getMessage().contains("No parser available for"));
}
} |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "ls";
} | @Test
public void testFormattedRowKey() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FORMATTED_RKF);
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.withRow("dummy", "str1", "str2",... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "ls";
} | @Test
public void testKijiLsStartAndLimitRow() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FOO_TEST);
kiji.createTable(layout.getDesc());
final KijiTable table = kiji.openTable(layout.getName());
try {
... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "ls";
} | @Test
public void testMultipleArguments() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FORMATTED_RKF);
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.withRow("dummy", "str1", "str2... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "scan";
} | @Test
public void testFormattedRowKey() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FORMATTED_RKF);
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.withRow("dummy", "str1", "str2",... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "scan";
} | @Test
public void testKijiScanStartAndLimitRow() throws Exception {
final Kiji kiji = getKiji();
TableLayoutDesc desc = KijiTableLayouts.getLayout(KijiTableLayouts.FOO_TEST);
((RowKeyFormat2)desc.getKeysFormat()).setEncoding(RowKeyEncoding.RAW);
final KijiTableLayout layout = KijiTableLayout... |
["('/** {@inheritDoc} */', '')"] | b'/** {@inheritDoc} */'@Override
public String getName() {
return "scan";
} | @Test
public void testRangeScanFormattedRKF() throws Exception {
final Kiji kiji = getKiji();
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FORMATTED_RKF);
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.withRow("NYC", "Technology... |
Register a schema @return Tool exit code @throws IOException in case of an error | b'/**\n * Register a schema.\n *\n * @return Tool exit code.\n * @throws IOException in case of an error.\n */'private int registerSchema() throws IOException {
final KijiSchemaTable table = mKiji.getSchemaTable();
final File file = new File(mRegisterFlag);
final Schema schema = new Schema.Pars... | @Test
public void testRegisterSchema() throws Exception {
assertEquals(BaseTool.SUCCESS, runTool(new SchemaTableTool(),
getKiji().getURI().toString(),
"--register=" + mFile.toString(),
"--interactive=false"
));
assertEquals(mSimpleSchema, mTable.getSchema(Long.parseLong(mToo... |
List all schemas in the table @return The Tool exit code @throws IOException in case of an error | b'/**\n * List all schemas in the table.\n *\n * @return The Tool exit code.\n * @throws IOException in case of an error.\n */'private int list() throws IOException {
final KijiSchemaTable schemaTable = mKiji.getSchemaTable();
long id = 0;
Schema schema = schemaTable.getSchema(id);
while (... | @Test
public void testList() throws Exception {
final long simpleSchemaId = getKiji().getSchemaTable().getOrCreateSchemaId(mSimpleSchema);
assertEquals(BaseTool.SUCCESS, runTool(new SchemaTableTool(),
getKiji().getURI().toString(),
"--list"));
assertTrue(mToolOutputStr.contains(
... |
Lookup a schema @return Tool exit code @throws IOException in case of an error | b'/**\n * Lookup a schema.\n *\n * @return Tool exit code.\n * @throws IOException in case of an error.\n */'private int lookupSchema() throws IOException {
final KijiSchemaTable table = mKiji.getSchemaTable();
final File file = new File(mLookupFlag);
final Schema schema = new Schema.Parser().p... | @Test
public void lookupSchema() throws Exception {
final BytesKey hash = mTable.getSchemaHash(mSimpleSchema);
final long id = mTable.getOrCreateSchemaId(mSimpleSchema);
assertEquals(BaseTool.SUCCESS, runTool(new SchemaTableTool(),
getKiji().getURI().toString(),
"--lookup=" + mFile.t... |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseValidMapEmpty() throws Exception {
final Map<String, String> kvs = mParser.parse("");
final Map<String, String> expected = ImmutableMap.<String, String>builder().build();
assertEquals(expected, kvs);
} |
['(\'/**\\\\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 {
KijiURI.newBuilder("kiji-hbase:///");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji-hbase:///' : ZooKeeper ensemble missing.",
kurie.getMessage());
}
... |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseValidMapOneEntry() throws Exception {
final Map<String, String> kvs = mParser.parse("key1=value1");
final Map<String, String> expected =
ImmutableMap.<String, String>builder().put("key1", "value1").build();
assertEquals(expected, kvs);
} |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseValidMapManyEntries() throws Exception {
final Map<String, String> kvs = mParser.parse("key1=value1 key2=value2 key3=value3");
final Map<String, String> expected = ImmutableMap.<String, String>builder()
.put("key1", "value1")
.put("key2", "value2")
.put... |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseValidMapEmptySpaces() throws Exception {
final Map<String, String> kvs = mParser.parse(" ");
final Map<String, String> expected = ImmutableMap.<String, String>builder().build();
assertEquals(expected, kvs);
} |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseValidMapManySpaces() throws Exception {
final Map<String, String> kvs = mParser.parse(" key1=value1 key2=value2 key3=value3 ");
final Map<String, String> expected = ImmutableMap.<String, String>builder()
.put("key1", "value1")
.put("key2", "value2")
... |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseInvalidMapNoEquals() throws Exception {
try {
final String input = "key1=value1 invalid key3=value3";
mParser.parse(input);
fail(String.format("Space-separated parser should have caught an error in '%s'", input));
} catch (IOException ioe) {
LOG.debug(... |
["('/**\\\\n * Parses a space-separated map into a Java map.\\\\n *\\\\n * @param input Space-separated map.\\\\n * @return the parsed Java map.\\\\n * @throws IOException on parse error.\\\\n */', '')"] | b'/**\n * Parses a space-separated map into a Java map.\n *\n * @param input Space-separated map.\n * @return the parsed Java map.\n * @throws IOException on parse error.\n */'public Map<String, String> parse(String input) throws IOException {
final Map<String, String> kvs = Maps.newHashMap();
f... | @Test
public void testParseInvalidMapDuplicateKey() throws Exception {
try {
final String input = "key1=value1 key1=value2";
mParser.parse(input);
fail(String.format("Space-separated parser should have caught an error in '%s'", input));
} catch (IOException ioe) {
LOG.debug("Exp... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testTooLargeInt() throws Exception {
try {
ToolUtils.createEntityIdFromUserInputs("['dummy', 'str1', 'str2', 2147483648, 10]",
mFormattedLayout);
fail("Should fail with EntityIdException.");
} catch (EntityIdException eie) {
assertEquals("Invalid type for c... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testTooLargeLong() throws Exception {
try {
ToolUtils.createEntityIdFromUserInputs("['dummy', 'str1', 'str2', 5, 9223372036854775808]",
mFormattedLayout);
fail("Should fail with EntityIdException.");
} catch (IOException ioe) {
assertEquals("Invalid JSON ... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testIntForLong() throws Exception {
final EntityIdFactory factory = EntityIdFactory.getFactory((RowKeyFormat2) mFormattedLayout
.getDesc().getKeysFormat());
final EntityId eid = factory.getEntityId("dummy", "str1", "str2", 5, 10);
assertEquals(eid, ToolUtils.createEntityId... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testTooFewComponents() throws IOException {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat2) mFormattedLayout.getDesc().getKeysFormat());
final EntityId eid = factory.getEntityId("dummy", "str1", "str2", 5, null);
assertEquals(eid,
ToolUt... |
['(\'/**\\\\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 {
KijiURI.newBuilder("kiji-hbase://zkhost1,zkhost2:1234/instance/table/col");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji-hbase://zkhost1,zkhost2:1234/instance... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testNonNullFollowsNull() throws IOException {
try {
ToolUtils
.createEntityIdFromUserInputs("['dummy', 'str1', 'str2', null, 5]", mFormattedLayout);
fail("Should fail with EntityIdException.");
} catch (EntityIdException eie) {
assertEquals("Non null comp... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testEmptyString() throws IOException {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat2) mFormattedLayout.getDesc().getKeysFormat());
final EntityId eid = factory.getEntityId("", "", "", null, null);
assertEquals(eid,
ToolUtils.createEntityI... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testASCIIChars() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat2) mFormattedLayout.getDesc().getKeysFormat());
for (byte b = 32; b < 127; b++) {
for (byte b2 = 32; b2 < 127; b2++) {
final EntityId eid = factory.getEnt... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testRawParserLoop() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat) mRawLayout.getDesc().getKeysFormat());
final EntityId eid = factory.getEntityIdFromHBaseRowKey(Bytes.toBytes("rawRowKey"));
assertEquals(eid,
ToolUtils.c... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testHashedParserLoop() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat) mHashedLayout.getDesc().getKeysFormat());
final EntityId eid = factory.getEntityId("hashedRowKey");
assertEquals(eid,
ToolUtils.createEntityIdFromUse... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testHashPrefixedParserLoop() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat) mHashPrefixedLayout.getDesc().getKeysFormat());
final EntityId eid = factory.getEntityId("hashPrefixedRowKey");
assertEquals(
eid, ToolUtils.cr... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testHBaseEIDtoRawEID() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat) mRawLayout.getDesc().getKeysFormat());
final EntityId reid = factory.getEntityId("rawEID");
final EntityId hbeid = HBaseEntityId.fromHBaseRowKey(reid.getHBaseRow... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testHBaseEIDtoHashedEID() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat) mHashedLayout.getDesc().getKeysFormat());
final EntityId heid = factory.getEntityId("hashedEID");
final EntityId hbeid = HBaseEntityId.fromHBaseRowKey(heid.ge... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testHBaseEIDtoHashPrefixedEID() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat) mHashPrefixedLayout.getDesc().getKeysFormat());
final EntityId hpeid = factory.getEntityId("hashPrefixedEID");
final EntityId hbeid = HBaseEntityId.from... |
['(\'/**\\\\n * Parses a command-line flag specifying an entity ID.\\\\n *\\\\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\\\\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\\\\n * necessary. The prefix is not always n... | b'/**\n * Parses a command-line flag specifying an entity ID.\n *\n * <li> HBase row key specifications must be prefixed with <code>"hbase=..."</code>\n * <li> Kiji row key specifications may be explicitly prefixed with <code>"kiji=..."</code> if\n * necessary. The prefix is not always necessary.\n *\n ... | @Test
public void testHBaseEIDtoFormattedEID() throws Exception {
final EntityIdFactory factory =
EntityIdFactory.getFactory((RowKeyFormat2) mFormattedLayout.getDesc().getKeysFormat());
final EntityId feid = factory.getEntityId("dummy", "str1", "str2", 5, 10);
final EntityId hbeid = HBaseEnti... |
["('/** {@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 testHashIsCalculatedWhenAllHashComponentsAreSpecified() throws Exception {
final int hashLength = 2;
RowKeyFormat2.Builder builder = RowKeyFormat2.newBuilder()
.setEncoding(RowKeyEncoding.FORMATTED)
.setSalt(new HashSpec(HashType.MD5, hashLength, false))
.setRan... |
['(\'/**\\\\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 {
KijiURI.newBuilder("kiji-hbase://zkhost1:1234,zkhost2:2345/instance/table/col");
fail("An exception should have been thrown.");
} catch (KijiURIException kurie) {
assertEquals("Invalid Kiji URI: 'kiji-hbase://zkhost1:1234,zkhos... |
["('/**\\\\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\\\\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\\\\n * the JVM to no longer be reachable.\\\\n *\\\\n * @param autoReferenceCountable to be registered to this reaper.\\\\n... | b'/**\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\n * the JVM to no longer be reachable.\n *\n * @param autoReferenceCountable to be registered to this reaper.\n */'public void re... | @Test
public void testReaperWillReapAutoReferenceCounted() throws Exception {
CountDownLatch latch = new CountDownLatch(1);
mReaper.registerAutoReferenceCounted(new LatchAutoReferenceCountable(latch));
System.gc(); // Force the phantom ref to be enqueued
Assert.assertTrue(latch.await(1, TimeUni... |
["('/**\\\\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\\\\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\\\\n * the JVM to no longer be reachable.\\\\n *\\\\n * @param autoReferenceCountable to be registered to this reaper.\\\\n... | b'/**\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\n * the JVM to no longer be reachable.\n *\n * @param autoReferenceCountable to be registered to this reaper.\n */'public void re... | @Test
public void testCloserWillCloseAutoReferenceCountedInWeakSet() throws Exception {
Set<AutoReferenceCounted> set =
Collections.newSetFromMap(
new MapMaker().weakKeys().<AutoReferenceCounted, Boolean>makeMap());
final CountDownLatch latch = new CountDownLatch(1);
AutoRefere... |
["('/**\\\\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\\\\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\\\\n * the JVM to no longer be reachable.\\\\n *\\\\n * @param autoReferenceCountable to be registered to this reaper.\\\\n... | b'/**\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\n * the JVM to no longer be reachable.\n *\n * @param autoReferenceCountable to be registered to this reaper.\n */'public void re... | @Test
public void testCloserWillCloseAutoReferenceCountedInWeakCache() throws Exception {
CountDownLatch latch = new CountDownLatch(1);
final LoadingCache<CountDownLatch, AutoReferenceCounted> cache = CacheBuilder
.newBuilder()
.weakValues()
.build(new CacheLoader<CountDownLatc... |
["('/**\\\\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\\\\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\\\\n * the JVM to no longer be reachable.\\\\n *\\\\n * @param autoReferenceCountable to be registered to this reaper.\\\\n... | b'/**\n * Register an {@link AutoReferenceCounted} instance to be cleaned up by this\n * {@code AutoReferenceCountedReaper} when the {@link AutoReferenceCounted} is determined by\n * the JVM to no longer be reachable.\n *\n * @param autoReferenceCountable to be registered to this reaper.\n */'public void re... | @Test
public void testWeakCacheWillBeCleanedUp() throws Exception {
CountDownLatch latch = new CountDownLatch(2);
final LoadingCache<CountDownLatch, AutoReferenceCounted> cache = CacheBuilder
.newBuilder()
.weakValues()
.build(new CacheLoader<CountDownLatch, AutoReferenceCounte... |
Reports whether the given schema is an optional type ie a union null Type @param schema The schema to test @return the optional type if the specified schema describes an optional type null otherwise | b'/**\n * Reports whether the given schema is an optional type (ie. a union { null, Type }).\n *\n * @param schema The schema to test.\n * @return the optional type, if the specified schema describes an optional type, null otherwise.\n */'public static Schema getOptionalType(Schema schema) {
Precondition... | @Test
public void testGetOptionalType() throws Exception {
final List<Schema> unionSchemas = Lists.newArrayList(
INT_SCHEMA,
NULL_SCHEMA);
final Schema optionalSchema = Schema.createUnion(unionSchemas);
final Schema optionalReverseSchema = Schema.createUnion(Lists.reverse(unionSchema... |
["('/**\\\\n * Reports whether the given schema is an optional type (ie. a union { null, Type }).\\\\n *\\\\n * @param schema The schema to test.\\\\n * @return the optional type, if the specified schema describes an optional type, null otherwise.\\\\n */', '')"] | b'/**\n * Reports whether the given schema is an optional type (ie. a union { null, Type }).\n *\n * @param schema The schema to test.\n * @return the optional type, if the specified schema describes an optional type, null otherwise.\n */'public static Schema getOptionalType(Schema schema) {
Precondition... | @Test
public void testGetNonOptionalType() throws Exception {
final List<Schema> unionSchemas = Lists.newArrayList(
INT_SCHEMA,
STRING_SCHEMA,
NULL_SCHEMA);
final Schema nonOptionalSchema = Schema.createUnion(unionSchemas);
// Ensure that null gets returned when the schema... |
["('/**\\\\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 testValidateSchemaPairMissingField() throws Exception {
final List<Schema.Field> readerFields = Lists.newArrayList(
new Schema.Field("oldfield1", INT_SCHEMA, null, null));
final Schema reader = Schema.createRecord(readerFields);
final AvroUtils.SchemaPairCompatibility expect... |
["('/**\\\\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 testValidateSchemaPairMissingSecondField() throws Exception {
final List<Schema.Field> readerFields = Lists.newArrayList(
new Schema.Field("oldfield2", STRING_SCHEMA, null, null));
final Schema reader = Schema.createRecord(readerFields);
final AvroUtils.SchemaPairCompatibili... |
["('/**\\\\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 testValidateSchemaPairAllFields() throws Exception {
final List<Schema.Field> readerFields = Lists.newArrayList(
new Schema.Field("oldfield1", INT_SCHEMA, null, null),
new Schema.Field("oldfield2", STRING_SCHEMA, null, null));
final Schema reader = Schema.createRecord(re... |
["('/**\\\\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 testValidateSchemaNewFieldWithDefault() throws Exception {
final List<Schema.Field> readerFields = Lists.newArrayList(
new Schema.Field("oldfield1", INT_SCHEMA, null, null),
new Schema.Field("newfield1", INT_SCHEMA, null, IntNode.valueOf(42)));
final Schema reader = Sche... |
['(\'/**\\\\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 testMultipleColumns() {
final KijiURI uri =
KijiURI.newBuilder("kiji-hbase://zkhost1,zkhost2/default/table/col1,col2").build();
assertEquals("zkhost1", uri.getZookeeperQuorum().get(0));
assertEquals("zkhost2", uri.getZookeeperQuorum().get(1));
assertEquals(KijiURI.DEFAU... |
["('/**\\\\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 testValidateSchemaNewField() throws Exception {
final List<Schema.Field> readerFields = Lists.newArrayList(
new Schema.Field("oldfield1", INT_SCHEMA, null, null),
new Schema.Field("newfield1", INT_SCHEMA, null, null));
final Schema reader = Schema.createRecord(readerFiel... |
["('/**\\\\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 testValidateArrayWriterSchema() throws Exception {
final Schema validReader = Schema.createArray(STRING_SCHEMA);
final Schema invalidReader = Schema.createMap(STRING_SCHEMA);
final AvroUtils.SchemaPairCompatibility validResult =
new AvroUtils.SchemaPairCompatibility(
... |
["('/**\\\\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 testValidatePrimitiveWriterSchema() throws Exception {
final Schema validReader = Schema.create(Schema.Type.STRING);
final AvroUtils.SchemaPairCompatibility validResult =
new AvroUtils.SchemaPairCompatibility(
AvroUtils.SchemaCompatibilityType.COMPATIBLE,
... |
["('/**\\\\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 testUnionReaderWriterSubsetIncompatibility() {
final Schema unionWriter = Schema.createUnion(
Lists.newArrayList(INT_SCHEMA, STRING_SCHEMA));
final Schema unionReader = Schema.createUnion(
Lists.newArrayList(STRING_SCHEMA));
final SchemaPairCompatibility result =
... |
["('/**\\\\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 testReaderWriterCompatibility() {
for (ReaderWriter readerWriter : COMPATIBLE_READER_WRITER_TEST_CASES) {
final Schema reader = readerWriter.getReader();
final Schema writer = readerWriter.getWriter();
LOG.debug("Testing compatibility of reader {} with writer {}.", reader,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.