Exemple #1
0
  static {
    // log4j Hack
    LoggerUtil.setupLogging();

    // Jar Caching!
    boolean reuse = false;
    if (System.getenv("ENABLE_JAR_REUSE") != null) {
      reuse = Boolean.valueOf(System.getenv("ENABLE_JAR_REUSE"));
      if (reuse) LOG.debug("ENABLE_JAR_REUSE = " + reuse);
    }
    ENABLE_JAR_REUSE = reuse;

    // HStoreConf Hack
    HStoreConf.init(null, null);
    HStoreConf.singleton().site.cpu_affinity = false;

    // Force everything to be single-threaded
    ThreadUtil.setMaxGlobalThreads(2);
  }
 static {
   for (Field field : ArgumentsParser.class.getDeclaredFields()) {
     try {
       if (field.getName().startsWith("PARAM_")) {
         ArgumentsParser.PARAMS.add(field.get(null).toString());
       }
     } catch (Exception ex) {
       ex.printStackTrace();
       System.exit(1);
     }
   } // FOR
 }; // STATIC
Exemple #3
0
  /**
   * Returns true if we have access to the Volt lib in our local system
   *
   * @return
   */
  public boolean hasVoltLib() throws Exception {
    File obj_dir = FileUtil.findDirectory("obj");

    // Figure out whether we are on a machine that has the native lib
    // we can use right now
    if (obj_dir != null) {
      File so_path = new File(obj_dir.getAbsolutePath() + "/release/nativelibs/libvoltdb.so");
      if (so_path.exists()) {
        System.load(so_path.getAbsolutePath());
        return (true);
      }
    }
    return (false);
  }