Package org.apache.hadoop.hbase.regionserver.compactions

Examples of org.apache.hadoop.hbase.regionserver.compactions.OffPeakCompactions


    long ttl = determineTTLFromFamily(family);
    // Why not just pass a HColumnDescriptor in here altogether?  Even if have
    // to clone it?
    scanInfo = new ScanInfo(family, ttl, timeToPurgeDeletes, this.comparator);
    this.memstore = new MemStore(conf, this.comparator);
    this.offPeakCompactions = new OffPeakCompactions(conf);

    // Setting up cache configuration for this family
    this.cacheConf = new CacheConfig(conf, family);

    this.verifyBulkLoads = conf.getBoolean("hbase.hstore.bulkload.verify", false);
View Full Code Here


    int hourPlusOne = ((hourOfDay+1)%24);
    int hourMinusOne = ((hourOfDay-1+24)%24);
    int hourMinusTwo = ((hourOfDay-2+24)%24);

    Configuration conf = TEST_UTIL.getConfiguration();
    OffPeakCompactions opc = new OffPeakCompactions(conf);
    LOG.debug("Testing without off-peak settings...");
    assertFalse(opc.tryStartOffPeakRequest());

    // set peak hour to current time and check compact selection
    conf.setLong("hbase.offpeak.start.hour", hourMinusOne);
    conf.setLong("hbase.offpeak.end.hour", hourPlusOne);
    opc = new OffPeakCompactions(conf);
    LOG.debug("Testing compact selection with off-peak settings (" +
        hourMinusOne + ", " + hourPlusOne + ")");
    assertTrue(opc.tryStartOffPeakRequest());
    opc.endOffPeakRequest();

    // set peak hour outside current selection and check compact selection
    conf.setLong("hbase.offpeak.start.hour", hourMinusTwo);
    conf.setLong("hbase.offpeak.end.hour", hourMinusOne);
    opc = new OffPeakCompactions(conf);
    assertFalse(opc.tryStartOffPeakRequest());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.regionserver.compactions.OffPeakCompactions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.