-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
I see a discrepancy between the behavior of withWhitelist and withBlacklist methods. I create the client using hostname "rh7v-intel64-90-test-16" . The other hosts in the cluster are rh7v-intel64-90-test-17.marklogic.com, rh7v-intel64-90-test-18.marklogic.com.
- When I blacklist "rh7v-intel64-90-test-16.marklogic.com", the forest configuration is
11:54:59.994 [main] INFO c.m.c.d.impl.WriteBatcherImpl - (withForestConfig) Using [rh7v-intel64-90-test-17.marklogic.com, rh7v-intel64-90-test-16, rh7v-intel64-90-test-18.marklogic.com] hosts with forests for "WriteHostBatcher"
- When I whitelist "rh7v-intel64-90-test-16.marklogic.com", the forest configuration is
11:45:26.494 [main] INFO c.m.c.d.impl.WriteBatcherImpl - (withForestConfig) Using [rh7v-intel64-90-test-16.marklogic.com] hosts with forests for "WriteHostBatcher"
@Test
public void testBlackWhiteList() throws Exception{
Assume.assumeTrue(hostNames.length > 1);
final String query1 = "fn:count(fn:doc())";
DatabaseClient dbClient = DatabaseClientFactory.newClient("rh7v-intel64-90-test-16", 8000, "admin", "admin", Authentication.DIGEST);
DataMovementManager dmManager = dbClient.newDataMovementManager();
FilteredForestConfiguration forestConfig = null;
DocumentMetadataHandle meta6 = new DocumentMetadataHandle().withCollections("NoHost").withQuality(0);
WriteBatcher ihb2 = dmManager.newWriteBatcher();
forestConfig = new FilteredForestConfiguration(dmManager.readForestConfig()).withWhiteList("rh7v-intel64-90-test-16.marklogic.com");
//forestConfig = new FilteredForestConfiguration(dmManager.readForestConfig()).withBlackList("rh7v-intel64-90-test-16.marklogic.com");
ihb2.withBatchSize(50).withForestConfig(forestConfig);
ihb2.onBatchSuccess(
batch -> {
}
)
.onBatchFailure(
(batch, throwable) -> {
throwable.printStackTrace();
}
);
for (int j =0 ;j < 1000; j++){
String uri ="/local/string-"+ j;
ihb2.addAs(uri, meta6 , jsonNode);
}
ihb2.flushAndWait();
Assert.assertTrue(dbClient.newServerEval().xquery(query1).eval().next().getNumber().intValue() == 1000);
}