Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
b2c213e
Added KeyIterator and StringKeyIterator services.
tkoop Mar 9, 2011
56fe276
removed shutdownHook register. was made redundant after inclusion of …
Mar 9, 2011
d276113
Merge branch 'master' of github.com:rantav/hector
Mar 9, 2011
d65a220
cleaner handling of value and name changes on underlying columns, add…
Mar 9, 2011
7d1e1ac
changed back to collection on pool impls keeping steady state semanti…
Mar 10, 2011
e86026c
revived jndi plumbing to work with current infrastructure
Mar 10, 2011
d5e67ae
added comments, cleanup up var names
Mar 10, 2011
e530e3d
added check for excludedhosts being equal to or greater than active i…
Mar 14, 2011
006225f
updated hector version number
Mar 15, 2011
39b1860
added template method design pattern, thx to David Cox for large cont…
Mar 16, 2011
c30d4fd
added multi-key queryColumns
Mar 16, 2011
1af6c0f
cleaner usage of slicepredicate
Mar 16, 2011
7c6628e
Updated to two-space tabs.
tkoop Mar 17, 2011
7e30a59
fix issue with BB serializer. Addresses GH issue 185
Mar 17, 2011
db854c0
Added setKeys/setColumnNames overloading with Collection type
Mar 12, 2011
dba4329
made trace default level for timing logger. Thanks to Chris Heron for…
Mar 17, 2011
70e8d3a
Merge branch 'master' of https://github.com/tkoop/hector into tkoop-m…
Mar 17, 2011
8751ec4
v0.8 specific changes for bringing up to date with latest cassandra t…
Mar 17, 2011
3b89e58
added CLs two and three
Mar 17, 2011
04e86a5
abstract template more generic
Mar 17, 2011
8c303dd
added missing test cases
Mar 18, 2011
91aab2b
added biginteger serializer
Mar 18, 2011
3d9fb84
added ascii serializer
Mar 18, 2011
a1f50d7
added keyCacheSavePeriodInSec. was missing. GH issue 191
Mar 21, 2011
d5ab3cc
updated doc link to point to wiki
Mar 21, 2011
6e39d16
updated template, mapping results, for standard, cleaner iface defini…
Mar 21, 2011
65e1b53
moved in DynamicComponent bean and support classes for support of upc…
edanuff Mar 22, 2011
c73ec33
added deserialization to DynamicComposite bean
edanuff Mar 22, 2011
eac3c8f
Fixed comparer to serializer mapping
edanuff Mar 22, 2011
a772f77
moved dynamic composite serializer into serializers package
edanuff Mar 22, 2011
15dbc4a
Fixes on DynamicComposite
edanuff Mar 22, 2011
c846609
Unit tests for DynamicComposite
edanuff Mar 22, 2011
493606e
Unit test for DynamicComposite bean
edanuff Mar 22, 2011
7dcdb29
Added utility method to DynamicComposite for specifying serializer wh…
edanuff Mar 22, 2011
b098390
Added options to override auto selection of serializers
edanuff Mar 23, 2011
07d53ea
modified DynamicCompositeTest
edanuff Mar 23, 2011
65bdd1f
Modified DynamicComposite to handle non-dynamic composites as well
edanuff Mar 23, 2011
5d7b6d0
Added test of deserializing static composites to unit test
edanuff Mar 23, 2011
0a44ca3
rename DynamicCompositeTest to CompositeTest
edanuff Mar 23, 2011
0ae44b5
removed unused logger from test
edanuff Mar 23, 2011
298a173
Edited core/src/main/java/me/prettyprint/cassandra/model/ExecutionRes…
Mar 23, 2011
551c124
Edited core/src/main/java/me/prettyprint/cassandra/model/AbstractSubC…
Mar 23, 2011
0393b6e
Refactored Composite into AbstractComposite, Composite, and DynamicCo…
edanuff Mar 23, 2011
269b10b
simplified alias mappings by using a BiMap from Google Collections
edanuff Mar 23, 2011
926778a
Cleaned mappings by using BiMap
edanuff Mar 23, 2011
e860cce
Merge branch 'master' of https://github.com/tamalex/hector into tamal…
Mar 23, 2011
baa374b
added fix to borked iface
Mar 23, 2011
73fd63c
forgot to not
Mar 23, 2011
3a434cb
added null check on comparator
Mar 23, 2011
f22818d
additional cleanup of cftemplate classes, particularly with ResultSta…
Mar 24, 2011
30559e5
First stab to counter. Interfaces and Abstract class added
patricioe Mar 24, 2011
f74d7e7
Add HCounterColumnImpl, rollback HColumnImpl and HAbstractColumnImpl
patricioe Mar 25, 2011
ce95d2b
Add new map of CounterMutation to BatchMutation. Add tests.
patricioe Mar 25, 2011
03daa89
encapsulate column creation in template classes
Mar 26, 2011
e55b871
Added support for descending sort
edanuff Mar 28, 2011
ff1a0d1
fixed Character.toUpperCase usage in AbstractComposite
edanuff Mar 28, 2011
74fc267
Add Hector implementation of CounterSuperColumn
patricioe Mar 28, 2011
7829cad
Remove CounterMutator as we to send all mutation together
patricioe Mar 28, 2011
d4bcb3e
CounterMutator is no longer needed in HFactory.
patricioe Mar 28, 2011
98e687a
Add Keyspace support and tes for counter add, get and remove
patricioe Mar 28, 2011
a4d46ed
Add convenient methods for creating a counter column
patricioe Mar 28, 2011
f8b40dc
Add convenient mehtod to create a HCounterSuperColumn
patricioe Mar 28, 2011
33e3dc2
encapsulated connection impl for template service
Mar 28, 2011
e091e08
update to ifaces for template result wrappers
Mar 28, 2011
0c097e5
made access level public for abstract class
Mar 29, 2011
3675c5e
Add CL > ONE for counters and wire Mutator with KS service
patricioe Mar 29, 2011
25e6917
cf result using linkedhashmap for ordering
Mar 29, 2011
5e2fba8
Made it possible to set serializers, comparators, and components by p…
edanuff Mar 30, 2011
45dfbde
Option to turn off deserialization of components
edanuff Mar 30, 2011
7d33bc9
Add Mutator test for insert counter column
patricioe Mar 30, 2011
c32c6da
Merge remote branch 'origin/master'
patricioe Mar 30, 2011
d8b6396
Complete the basic add/get/remove simple CF counter
patricioe Mar 30, 2011
952c753
Increment and decrement counters in one step (Convenient methods)
patricioe Mar 30, 2011
b0a2c38
Able to serialize and deserialize null values
edanuff Mar 30, 2011
5f06b04
added patch for disabling auto-deserialize by default. Thanks to Todd9.
Mar 30, 2011
50daddb
Made deserialization of components lazy and occur at get() time
edanuff Mar 30, 2011
02b1c7c
Removed setAutodeserialize in DynamicCompositeSerializer as it's no l…
edanuff Mar 30, 2011
ab4a8e2
Added a few more tests to CompositeTest
edanuff Mar 30, 2011
7266689
better use of predicate in template
Mar 31, 2011
4832331
fixed issue with test on cf template, gutted scf template and test fo…
Mar 31, 2011
192e676
supercol inserts working on template innards
Mar 31, 2011
f41c07f
supercol inserts working on template innards
Mar 31, 2011
fac6141
cleaner approach to selection of supercf in templates
Apr 1, 2011
e1346ed
Support for "tiebreaker" value to specify that individual component v…
edanuff Apr 1, 2011
5316e50
added get for columnnames on result set
Apr 1, 2011
91b17e5
Merge branch 'master' of github.com:rantav/hector
Apr 1, 2011
e0779b9
Change to make reverse sort consistent with CASSANDRA-2355 patch
edanuff Apr 1, 2011
4dc3c77
added method to iface for template
Apr 1, 2011
75fb64e
Merge branch 'master' of github.com:rantav/hector
Apr 1, 2011
9309e10
added two new primitive type serializers
Apr 1, 2011
26641ce
Fixed mapping of numbers into BigInteger for proper comparison by Cas…
edanuff Apr 2, 2011
74c2583
Added getComparatorType() to serializers to return Cassandra comparat…
edanuff Apr 2, 2011
0319d62
convenience methods for creating composite from list
edanuff Apr 3, 2011
5db79d3
Made AbstractComposite flatten collections passed to addAll, etc. to …
edanuff Apr 4, 2011
7f37a03
In AbstractComposite, do the correct thing with add() or set() is cal…
edanuff Apr 4, 2011
a4a896d
minor fix in AbstractComposite.add()
edanuff Apr 4, 2011
3f20ed4
changes for smoother supercol integration w. other protocols
Apr 4, 2011
00eca6e
Merge branch 'master' of github.com:rantav/hector
Apr 4, 2011
2d02c07
AbstractComponent.addAll() etc. now do the right thing if called with…
edanuff Apr 4, 2011
14b6b5f
build out of supercol methods on template
Apr 4, 2011
f41f210
added new mapped results for supercf
Apr 4, 2011
9125040
added querysinglecol for supercol template
Apr 4, 2011
b7735ef
fixed issue with pointing at correct update
Apr 4, 2011
de78ca8
added null check on sc hit
Apr 4, 2011
358b15d
fixed bug causing corrupt composite serialization
edanuff Apr 5, 2011
832947c
super col result wrapping smoothed out, coverage for such
Apr 5, 2011
86dc99c
Merge branch 'master' of github.com:rantav/hector
Apr 5, 2011
6bea28c
added multikey, multi-sf method
Apr 5, 2011
dc2d226
added multikey only method
Apr 5, 2011
b59368f
added overloaded form of single key for all supercols
Apr 5, 2011
4b34c5b
added getActiveSuperCOlumn
Apr 5, 2011
ee5e807
Add null check for querySingleSubColumn
patricioe Apr 5, 2011
963314a
added hasResults method to return false on no results
Apr 5, 2011
71bc15f
removed executiontime checks
Apr 5, 2011
c0e2f7c
Add Mutator.superDelete to delte super columns and test
patricioe Apr 6, 2011
05b38ab
set -Dfile.encoding=UTF-8 in pom.xml so surefire runs tests with utf…
edanuff Apr 6, 2011
d00d820
set -Dsun.jnu.encoding=UTF-8 in pom.xml
edanuff Apr 6, 2011
9bac88a
added public ComparatorType getComparatorType() to serializer
edanuff Apr 6, 2011
05d108e
added additional deletion signatures for deletion in mutator, usage o…
Apr 6, 2011
0059ab7
more test coverage of update SC, added timestamps to subcols
Apr 6, 2011
5a68930
tweak to clock on superDelete
Apr 6, 2011
c2bcc0c
override template level deletes for supercols, coverage for such
Apr 6, 2011
d555ecf
added describeSchemaVersions
Apr 8, 2011
a819b82
Added support for new UUIDType from https://issues.apache.org/jira/br…
edanuff Apr 9, 2011
481b2ba
bug fix for null composite value
edanuff Apr 10, 2011
15ddb03
fix getExhaustedPoolNames, was returning an empty set
Apr 14, 2011
1e917aa
updated to latest 0.8 rev, converted mutators to simpler API, fixed K…
Apr 15, 2011
1431917
add get_slice for counters.
patricioe Apr 18, 2011
a5da409
First proposal to switch to Speed4j.
Apr 19, 2011
5cfd9c7
Now using 0.5 speed4j proper.
Apr 19, 2011
5627182
potential work around for improperly wrapped socket timeout exception…
Apr 20, 2011
8a6f22b
moved check for transport exception to where it will actually do some…
Apr 20, 2011
4717c1c
Added option for setting keepalive on the underlying socket. Defaults…
Apr 26, 2011
b7947de
updated logger level to more appropriate warn
Apr 28, 2011
cd5410a
Committer: Oleg Tsvinev <oleg.tsvinev@gmail.com>
Apr 28, 2011
c2aeed0
make hector build for cassandra beta1 changes (see r1094102 and r1094…
michaelsembwever Apr 29, 2011
40b949e
Merged pull request #206 from michaelsembwever/master.
Apr 29, 2011
6b91d93
additional cleanup from bump of 0.8 to beta, fixes in HOM implied by …
Apr 29, 2011
1f18e6f
Add ability to return a timestamp based on UUID
patricioe May 16, 2011
25c2810
warning message when adding zero-length bytestype components
edanuff Apr 11, 2011
213f788
Merge pull request #202 from jalkanen/master
May 18, 2011
3043b22
Merge pull request #205 from teosoft123/master
May 18, 2011
33b925f
changed UnsupportedException to RuntimeException since it is openjpa
May 19, 2011
6ffa130
was never setting cassandraStarted to true causing unit tests to try
May 19, 2011
04b2848
added ignore for 'target' dir
May 19, 2011
9c12ef8
removed openjpa and JPA 2.0 targeted code just to be clear this
May 19, 2011
b2ee5f9
changed HOM version to 1.1-01-SNAPSHOT ... the 1.1 is for the 0.8
May 19, 2011
9b777c9
reset to the results of adding the pool to the connection manager. Th…
May 20, 2011
385303a
fixed retry logic in the case of fail after one more try configuratio…
May 20, 2011
c88e59d
adding recommended default configuration string for dynamic comparator
edanuff May 21, 2011
c9f3d3e
first cut of CqlQuery, loosened OrderedRowsImpl to hornshoe in results
May 24, 2011
9642077
added additional javadoc, test coverage for validation format error
May 24, 2011
093f25a
Upgrade to cassandra beta2
patricioe May 27, 2011
85070fb
Merge remote branch 'origin/master'
patricioe May 27, 2011
f3d23e3
- add CfDef.key_validation_class support
michaelsembwever May 31, 2011
39ec095
Remove whitespace [Gun.io WhitespaceBot]
Oct 28, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Versions above 0.7.0-17 work well with cassandra's 0.7.* (after 0.7.0-beta2)

0.7.0-27
========
Execution time is now actually in micro seconds. Thanks to several folks for pointing this out.
Execution time is now actually in micro seconds. Thanks to several folks for pointing this out.
Added IO stream mutators. Thanks to Norman Maurer for the pull request.
Added method to HFactory for safe shutdown of cluster
Added suspend/unsuspend operations to HConnectionManager, operations for suh in JMX
Cleanup of numActive counter on ConcurrentHClientPool. Could cause negative results under some high-load situations. Thanks to Yang Yang for the tip.
fix NPE with poolExhaustedException. Thanks to Yang Yang for the tip
Fixed issue with ttl not being set on result columns. Thanks to ML user Kallin for the heads up.
Fixed issue with ttl not being set on result columns. Thanks to ML user Kallin for the heads up.

0.7.0-26
========
Fix issue with NPE in ThriftColumnDef when a column name was declared with no index type (thanks to Steve Willcox for the heads up)
Mutator has easier row level deletion methods
Fix potential race condition in ConcurrentHClientPool with large number of threads. https://github.com/rantav/hector/issues#issue/136 (Thanks to @masseyke for the test case)
LeastActive policy updated to shuffle before selection. This spreads load out better among pools in low to moderate traffic environments (ie. when ConcurrentHClientPool#getNumActive are all equal).
LeastActive policy updated to shuffle before selection. This spreads load out better among pools in low to moderate traffic environments (ie. when ConcurrentHClientPool#getNumActive are all equal).
Fix NPE in checking that cassandraHostRetryService is turned when host is being marked down (thanks to ML poster Shimi for bug report)
A CassandraClientMonitor instance is now created per cluster to make JMX integration with multi-cluster setups much easier. (https://github.com/rantav/hector/issues/issue/137)

Expand All @@ -33,7 +33,7 @@ Fix issue with RR Load balancing policy that cause ArrayOutOfBounds.. in some si
0.7.0-24
========
Fixed issue with null keyspaces and credentials in HConnectionManager (via Michael Moores)
Added class-level default for failoverPolicy
Added class-level default for failoverPolicy
Rudimentary (very much so) JPA 2.0 support for save and load via openjpa
Ligthweight ORM for JPA 1.0 annotations (additional improvements to BTodd's hector-object-mapper merged in)
Some cleanup of bytebuffer handling in serializers
Expand All @@ -47,17 +47,17 @@ CassandraHostRetryService default queue size now defaults unbounded
Initial import of BToddB's hector-object-mapper as object-mapper module
Object mapper ported over to JPA annotations and EntityManager (very redimentary support)
Fix issue with createKeyspace requiring additional column info
Massive changes to pom structure courtesy of Stephen Connolly to facilitate inclusion into maven central repository.
Massive changes to pom structure courtesy of Stephen Connolly to facilitate inclusion into maven central repository.
Small tweaks to HConnectionManager courtesy of Benoit Perroud
Collection conversions in AbstractSerializer use the size of the provided collection for initialization. Patch courtesy of Benoit Perroud.
Collection conversions in AbstractSerializer use the size of the provided collection for initialization. Patch courtesy of Benoit Perroud.
Treat HUnavailableException the same as HTimeoutException

0.7.0-22
========
Fix issue with LeastActiveBalancingPolicy that favoured same host repeatedly
Define ClockResolution as an Interface to allow client to define their own implementations
Added TimeUUID support (me.prettyprint.cassandra.utils.TimeUUIDUtils)
Added updateColumnFamily to Cluster
Added updateColumnFamily to Cluster
Shorterm fix for catching InvalidRequestException and handling it correctly for a bootstraping node


Expand Down Expand Up @@ -89,7 +89,7 @@ Refactoring of the connection pooling innards to fix epic race condition on fail
- Removal of classes effectively matching the pattern CassandraClient* from the service package
- Command is gone. It was no longer needed and was more confusing than anything else
- Pooling logic has been stress tested by a neutral third party (no, really!)
Upgrade to thrift 0.5 to match Cassandra (it caught us by surprise as well).
Upgrade to thrift 0.5 to match Cassandra (it caught us by surprise as well).
The system_rename_* methods were removed matching removal of such in Thrift API
Microsecond level granularity is now the default
NodeAutoDiscoverService will periodically look for new hosts on the ring and add them (off by default)
Expand All @@ -103,13 +103,13 @@ Move all the API stuff to me.prettyprint.hector.api.*. Extract interfaces and pr
- Rename KeyspaceOperator and extract a Keyspace interface from it
Rename a few exceptions to begin with HSomething so they are hard to unintentionally mix with their thrift doubles.
Bug fixes:
CassandraClientPoolByHostImpl can throw NoSuchElementException
CassandraClientPoolByHostImpl can throw NoSuchElementException
KeyspaceImpl.toString returns super.toString()
API V2 has no means of getting all columns from a row.
KeyspaceOperator throws NPE that masks real exceptions
Timestamp (and Clock in 0.7.0) are not set on HColumn in the constructor
Friendlier API and spring integration
Error in failover - incorrect operation when borrowClient throws an
Error in failover - incorrect operation when borrowClient throws an
batchMutate doesn't work with null predicate in deletion. Cannot batch-delete rows.
getSuperColumn() does not return null
KeyspaceImpl.getSuperColumn() should use cassandra.get() and not cassandra.get_slice()
Expand Down
7 changes: 4 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The current 0.7.0 branch will work with Apache Cassandra 0.7.x. The master has been switched to tracking Apache Cassandra 0.8.0. Current releases on the downloads section should be cosidered production ready. You should always choose the most recent release for your version of Apache Cassandra.

As of version 0.7.0-23, Hector artificats are deployed to Maven Central. If you use maven for your build system, you need only include the hector-core dependency and all related dependencies will be managed automatically.
As of version 0.7.0-23, Hector artificats are deployed to Maven Central. If you use maven for your build system, you need only include the hector-core dependency and all related dependencies will be managed automatically.
----------------------------------------------------------------------------------------------------

Hector is a high level Java client for Apache Cassandra.
Expand All @@ -25,9 +25,10 @@ Some features provided by this client:
o simple ORM layer that works
o a type-safe approach to dealing with Apache Cassandra's data model

Detailed documentation of Hector features and usage can be found in PDF form hosted by Riptano: http://www.riptano.com/sites/default/files/hector-v2-client-doc.pdf
Detailed documentation of Hector features and usage can be found on the wiki:
https://github.com/rantav/hector/wiki/User-Guide

Some interesting pages from the wiki:
Some additional pages from the wiki that may be of interest:

o SLF4J fun and hijinks: https://github.com/rantav/hector/wiki/SLF4J-in-Hector-
o Mailing Lists: https://github.com/rantav/hector/wiki/Mailing-Lists
Expand Down
116 changes: 62 additions & 54 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>always</forkMode>
<argLine>-Xmx512M -Xms512M</argLine>
<argLine>-Xmx512M -Xms512M -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
Expand All @@ -105,63 +105,66 @@
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>0.8.0-20110216</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra.deps</groupId>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-thrift</artifactId>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.6</version>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r08</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r08</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cassandra.deps</groupId>
<artifactId>avro</artifactId>
<version>1.4.0-cassandra-1</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra.deps</groupId>
<artifactId>avro</artifactId>
<version>1.4.0-cassandra-1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>netty</artifactId>
<groupId>org.jboss.netty</groupId>
</exclusion>
<exclusion>
<artifactId>paranamer</artifactId>
<groupId>com.thoughtworks.paranamer</groupId>
</exclusion>
<exclusion>
<artifactId>paranamer-ant</artifactId>
<groupId>com.thoughtworks.paranamer</groupId>
</exclusion>
<exclusion>
<artifactId>velocity</artifactId>
<groupId>org.apache.velocity</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr</artifactId>
<exclusions>
<exclusion>
<artifactId>netty</artifactId>
<groupId>org.jboss.netty</groupId>
</exclusion>
<exclusion>
<artifactId>paranamer</artifactId>
<groupId>com.thoughtworks.paranamer</groupId>
</exclusion>
<exclusion>
<artifactId>paranamer-ant</artifactId>
<groupId>com.thoughtworks.paranamer</groupId>
</exclusion>
<exclusion>
<artifactId>velocity</artifactId>
<groupId>org.apache.velocity</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr</artifactId>
<version>3.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
<artifactId>concurrentlinkedhashmap-lru</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
<artifactId>concurrentlinkedhashmap-lru</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -187,9 +190,9 @@
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.perf4j</groupId>
<artifactId>perf4j</artifactId>
<version>0.9.12</version>
<groupId>com.ecyrd.speed4j</groupId>
<artifactId>speed4j</artifactId>
<version>0.5</version>
</dependency>

<!-- Note the optional tag. If you need to use fastinfoset serialization, you must include this dependency in your project! -->
Expand Down Expand Up @@ -226,7 +229,7 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
Expand Down Expand Up @@ -280,5 +283,10 @@
<name>riptano</name>
<url>http://mvn.riptano.com/content/repositories/public/</url>
</repository>
<repository>
<id>apache-staging</id>
<name>apache-staging</name>
<url>https://repository.apache.org/content/repositories/orgapachecassandra-114</url>
</repository>
</repositories>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ public BackgroundCassandraHostService(HConnectionManager connectionManager,
CassandraHostConfigurator cassandraHostConfigurator) {
this.connectionManager = connectionManager;
this.cassandraHostConfigurator = cassandraHostConfigurator;
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
shutdown();
}
});

}

abstract void shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public CassandraHostRetryService(HConnectionManager connectionManager,
super(connectionManager, cassandraHostConfigurator);
this.exceptionsTranslator = connectionManager.exceptionsTranslator;
this.retryDelayInSeconds = cassandraHostConfigurator.getRetryDownedHostsDelayInSeconds();
downedHostQueue = new LinkedBlockingQueue<CassandraHost>(cassandraHostConfigurator.getRetryDownedHostsQueueSize() < 1
downedHostQueue = new LinkedBlockingQueue<CassandraHost>(cassandraHostConfigurator.getRetryDownedHostsQueueSize() < 1
? Integer.MAX_VALUE : cassandraHostConfigurator.getRetryDownedHostsQueueSize());

sf = executor.scheduleWithFixedDelay(new RetryRunner(), this.retryDelayInSeconds,this.retryDelayInSeconds, TimeUnit.SECONDS);

log.info("Downed Host Retry service started with queue size {} and retry delay {}s",
Expand Down Expand Up @@ -87,17 +87,16 @@ class RetryRunner implements Runnable {
public void run() {
CassandraHost cassandraHost = downedHostQueue.poll();
if ( cassandraHost == null ) {
if ( log.isDebugEnabled() ) {
if ( log.isDebugEnabled() ) {
log.debug("Retry service fired... nothing to do.");
}
return;
}

boolean reconnected = verifyConnection(cassandraHost);
log.info("Downed Host retry status {} with host: {}", reconnected, cassandraHost.getName());
if ( reconnected ) {
//cassandraClientPool.getCluster().addHost(cassandraHost, true);
connectionManager.addCassandraHost(cassandraHost);
reconnected = connectionManager.addCassandraHost(cassandraHost);
}
if ( !reconnected && cassandraHost != null ) {
downedHostQueue.add(cassandraHost);
Expand All @@ -112,23 +111,20 @@ private boolean verifyConnection(CassandraHost cassandraHost) {
boolean found = false;
HThriftClient client = new HThriftClient(cassandraHost);
try {

client.open();
found = client.getCassandra().describe_cluster_name() != null;
client.close();
} catch (HectorTransportException he) {
client.close();
} catch (HectorTransportException he) {
log.warn("Downed {} host still appears to be down: {}", cassandraHost, he.getMessage());
} catch (Exception ex) {

log.error("Downed Host retry failed attempt to verify CassandraHost", ex);
}

}
return found;
}

}

// TODO create callable to handle checking

// perhaps wrap CassandraHost and add a lastRetryTime?
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public HThriftClient borrowClient() throws HectorException {
if ( tillExhausted > 0 ) {
// if we start with #of threads == getMaxActive, we could trigger this condition
// replace addClientToPoolGently(new HThriftClient(cassandraHost).open()) with immediate acquisition
return greedyCreate();
return greedyCreate();
}
// blocked take on the queue if we are configured to wait forever
if ( log.isDebugEnabled() ) {
Expand Down Expand Up @@ -109,7 +109,7 @@ public HThriftClient borrowClient() throws HectorException {

return cassandraClient;
}

/**
* Used when we still have room to grow. Return an HThriftClient without
* having to wait on polling logic. (But still increment all the counters)
Expand Down
Loading