예제 #1
0
  /**
   * Constructor for URL Tracker EXAMPLE class.
   *
   * @param console
   * @param host
   * @param port
   * @param namespace
   * @param baseNamespace
   * @param cacheNamespace
   * @param fileName
   * @param ldtType
   * @param clean
   * @param remove
   * @param customers
   * @param records
   * @param generateCount
   * @param threadCount
   * @param cleanIntervalSec
   * @param cleanDurationSec
   * @param cleanMethod
   * @param timeToLive
   * @param noLoad
   * @param loadOnly
   * @param noCleanThreads
   * @param doScan
   * @param emulationDays
   * @throws AerospikeException
   */
  public UrlTracker(
      Console console,
      String host,
      int port,
      String namespace,
      String baseNamespace,
      String cacheNamespace,
      String fileName,
      String ldtType,
      boolean clean,
      boolean remove,
      long customers,
      long records,
      long generateCount,
      int threadCount,
      int cleanIntervalSec,
      long cleanDurationSec,
      int cleanMethod,
      long timeToLive,
      boolean noLoad,
      boolean loadOnly,
      boolean noCleanThreads,
      boolean doScan,
      int emulationDays)
      throws AerospikeException {
    this.host = host;
    this.port = port;
    this.namespace = namespace;
    this.baseNamespace = baseNamespace;
    this.cacheNamespace = cacheNamespace;
    this.parms = new DbParameters(host, port, namespace, baseNamespace, cacheNamespace);

    this.dbOps = new DbOps(console, parms, ldtType);

    this.client = dbOps.getClient();
    this.inputFileName = fileName;
    this.ldtType = ldtType;
    this.console = console;
    this.cleanBefore = clean;
    this.cleanAfter = remove;
    this.customerRecords = customers;
    this.threadCount = threadCount;
    this.userRecords = records;
    this.timeToLive = timeToLive;

    // If non-zero, then generate data rather than read from JSON file.
    this.generateCount = generateCount;

    this.cleanIntervalSec = cleanIntervalSec;
    this.cleanDurationSec = cleanDurationSec;
    this.cleanMethod = cleanMethod;

    this.noLoad = noLoad;
    this.loadOnly = loadOnly;

    this.doScan = doScan;

    this.noCleanThreads = noCleanThreads;
    this.emulationDays = emulationDays;

    this.testTiming = new TestTiming();
  } // end UrlTracker constructor