cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [3/5] cassandra git commit: Expose commit log archiver status via JMX
Date Wed, 11 Mar 2015 16:27:54 GMT
Expose commit log archiver status via JMX

Patch by clohfink; reviewed by jmckenzie for CASSANDRA-8734


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/77c66bf9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/77c66bf9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/77c66bf9

Branch: refs/heads/trunk
Commit: 77c66bf9f50228306d4bf76bb2721c731875f261
Parents: d6ea0ff
Author: Chris Lohfink <clohfink85@gmail.com>
Authored: Wed Mar 11 11:14:59 2015 -0500
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Wed Mar 11 11:14:59 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/db/commitlog/CommitLog.java       | 30 +++++++++++++++++++
 .../db/commitlog/CommitLogArchiver.java         |  6 ++--
 .../cassandra/db/commitlog/CommitLogMBean.java  | 31 ++++++++++++++++++++
 4 files changed, 65 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/77c66bf9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d240a10..382b3dd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.14:
+ * Expose commit log archive status via JMX (CASSANDRA-8734)
  * Provide better exceptions for invalid replication strategy parameters
    (CASSANDRA-8909)
  * Fix regression in mixed single and multi-column relation support for

http://git-wip-us.apache.org/repos/asf/cassandra/blob/77c66bf9/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
index 7a27653..a3ce804 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
@@ -299,6 +299,36 @@ public class CommitLog implements CommitLogMBean
         return metrics.totalCommitLogSize.value();
     }
 
+    @Override
+    public String getArchiveCommand()
+    {
+        return archiver.archiveCommand;
+    }
+
+    @Override
+    public String getRestoreCommand()
+    {
+        return archiver.restoreCommand;
+    }
+
+    @Override
+    public String getRestoreDirectories()
+    {
+        return archiver.restoreDirectories;
+    }
+
+    @Override
+    public long getRestorePointInTime()
+    {
+        return archiver.restorePointInTime;
+    }
+
+    @Override
+    public String getRestorePrecision()
+    {
+        return archiver.precision.toString();
+    }
+
     /**
      * Fetches a new segment file from the allocator and activates it.
      *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/77c66bf9/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
index 8957643..fd03624 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java
@@ -53,9 +53,9 @@ public class CommitLogArchiver
 
     public final Map<String, Future<?>> archivePending = new ConcurrentHashMap<String,
Future<?>>();
     public final ExecutorService executor = new JMXEnabledThreadPoolExecutor("commitlog_archiver");
-    private final String archiveCommand;
-    private final String restoreCommand;
-    private final String restoreDirectories;
+    final String archiveCommand;
+    final String restoreCommand;
+    final String restoreDirectories;
     public final long restorePointInTime;
     public final TimeUnit precision;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/77c66bf9/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
index 6c0d8d7..9f3eb9b 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
@@ -45,6 +45,37 @@ public interface CommitLogMBean
     public long getTotalCommitlogSize();
 
     /**
+     *  Command to execute to archive a commitlog segment.  Blank to disabled.
+     */
+    public String getArchiveCommand();
+
+    /**
+     * Command to execute to make an archived commitlog live again
+     */
+    public String getRestoreCommand();
+
+    /**
+     * Directory to scan the recovery files in
+     */
+    public String getRestoreDirectories();
+
+    /**
+     * Restore mutations created up to and including this timestamp in GMT
+     * Format: yyyy:MM:dd HH:mm:ss (2012:04:31 20:43:12)
+     *
+     * Recovery will continue through the segment when the first client-supplied
+     * timestamp greater than this time is encountered, but only mutations less than
+     * or equal to this timestamp will be applied.
+     */
+    public long getRestorePointInTime();
+
+    /**
+     * get precision of the timestamp used in the restore (MILLISECONDS, MICROSECONDS, ...)
+     * to determine if passed the restore point in time.
+     */
+    public String getRestorePrecision();
+
+    /**
      * Recover a single file.
      */
     public void recover(String path) throws IOException;


Mime
View raw message