Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 185375] lots of clean up, refactoring, and perf improvements
Browse files Browse the repository at this point in the history
The TaskTracker class has been copied into the source tree from the
service-metrics maven module. The reason for copying the class is beause the
changes for this BZ are going into a patch release, and I want to minimize the
number of modules that have to be touched for this.

We no longer query the rdbms to load schedule ids. Instead we use the legacy
thrift APIs via the hector library to scan for schedule ids. This way, we query
for only those schedule ids that have data.

Reads are now throttled using a RateLimiter. This is better than using a
semaphore for a couple reasons. First, we do not have to worry about releasing
permits, which had to be done in a couple different places in the code.
Secondly, it is more expressive about the throughput. With a semaphore, it was
hard to determine the read throughput, whereas with RateLimiter it is directly
specified as querys per second.

The migration code previously tried to abort processing if a write failed. This
made the code overly complicated. Since we are now using batches, we only do a
handful of writes per schedule id. We now just have the failure detection and
handling code in the migration finished callback. This simplifies things a lot.
  • Loading branch information
John Sanda authored and spinder committed Mar 2, 2015
1 parent b9cbea1 commit 2d3bdab
Show file tree
Hide file tree
Showing 6 changed files with 476 additions and 557 deletions.
13 changes: 13 additions & 0 deletions modules/common/cassandra-schema/pom.xml
Expand Up @@ -41,6 +41,13 @@
<version>${cassandra.driver.version}</version>
</dependency>

<dependency>
<groupId>me.prettyprint</groupId>
<artifactId>hector-core</artifactId>
<version>1.0-5</version>
<!--<scope>test</scope>-->
</dependency>

<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
Expand Down Expand Up @@ -71,6 +78,12 @@
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>

<build>
Expand Down
@@ -0,0 +1,23 @@
package org.rhq.cassandra.schema;

/**
* @author John Sanda
*/
public class AbortedException extends Exception {

public AbortedException() {
super();
}

public AbortedException(String message) {
super(message);
}

public AbortedException(String message, Throwable cause) {
super(message, cause);
}

public AbortedException(Throwable cause) {
super(cause);
}
}

0 comments on commit 2d3bdab

Please sign in to comment.