Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,25 @@ public static Configuration setUpConfigForMiniCluster(Configuration conf,
ReadOnlyProps overrideProps) throws Exception {
assertNotNull(conf);
setDefaultTestConfig(conf, overrideProps);
// Some tests inject a clock that runs ahead of the wall clock. The HBase 2.x WAL roller
// compares the injected clock with the wall clock. When the difference is more than the roll
// period, the roller rolls the WAL on each pass. For this reason, the first two values disable
// the periodic roll for the region server WALs and for the WAL of the master local region.
// Rolls for size and requested rolls continue to occur.
//
// The WAL output stream measures the datanode acknowledgment time with the injected clock. A
// forward jump of the clock thus looks like a slow datanode. A mini cluster often has only one
// datanode. When the WAL excludes it, the WAL cannot create its next file, and the server
// aborts. The third value prevents the exclusion of a datanode because of slow acknowledgments.
//
// The default test configuration copies the HBase defaults. Thus this method sets these values
// after it. An override property for one of these keys has priority.
setIfNotOverridden(conf, overrideProps, "hbase.regionserver.logroll.period",
Long.toString(Long.MAX_VALUE));
setIfNotOverridden(conf, overrideProps, "hbase.master.store.region.walroll.period.ms",
Long.toString(Long.MAX_VALUE));
setIfNotOverridden(conf, overrideProps, "hbase.regionserver.async.wal.min.slow.detect.count",
Integer.toString(Integer.MAX_VALUE));
/*
* The default configuration of mini cluster ends up spawning a lot of threads that are not
* really needed by phoenix for test purposes. Limiting these threads helps us in running
Expand Down Expand Up @@ -614,6 +633,13 @@ public static Configuration setUpConfigForMiniCluster(Configuration conf,
return conf;
}

private static void setIfNotOverridden(Configuration conf, ReadOnlyProps overrideProps,
String key, String value) {
if (overrideProps.get(key) == null) {
conf.set(key, value);
}
}

/*
* Set property hbase.coprocessor.regionserver.classes to include test implementation of
* PhoenixRegionServerEndpoint by default, if some other regionserver coprocs are not already
Expand Down
Loading