コード例 #1
0
ファイル: CommitLog.java プロジェクト: Jashinta/570
  /**
   * param @ table - name of table for which we are maintaining this commit log. param @
   * recoverymode - is commit log being instantiated in in recovery mode.
   */
  private CommitLog() {
    try {
      DatabaseDescriptor.createAllDirectories();
      segmentSize = DatabaseDescriptor.getCommitLogSegmentSize();
    } catch (IOException e) {
      throw new IOError(e);
    }

    // all old segments are recovered and deleted before CommitLog is instantiated.
    // All we need to do is create a new one.
    segments.add(new CommitLogSegment());

    executor =
        DatabaseDescriptor.getCommitLogSync() == Config.CommitLogSync.batch
            ? new BatchCommitLogExecutorService()
            : new PeriodicCommitLogExecutorService(this);
  }
コード例 #2
0
  @VisibleForTesting
  CommitLog(String location, CommitLogArchiver archiver) {
    compressorClass = DatabaseDescriptor.getCommitLogCompression();
    this.location = location;
    ICompressor compressor =
        compressorClass != null ? CompressionParameters.createCompressor(compressorClass) : null;
    DatabaseDescriptor.createAllDirectories();

    this.compressor = compressor;
    this.archiver = archiver;
    metrics = new CommitLogMetrics();

    executor =
        DatabaseDescriptor.getCommitLogSync() == Config.CommitLogSync.batch
            ? new BatchCommitLogService(this)
            : new PeriodicCommitLogService(this);

    allocator = new CommitLogSegmentManager(this);

    // register metrics
    metrics.attach(executor, allocator);
  }
コード例 #3
0
ファイル: CassandraServer.java プロジェクト: compae/Decision
 private static void mkdirs() {
   DatabaseDescriptor.createAllDirectories();
 }