-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DATACASS-38 - Cluster Connection Listener
Added Host.StateListener Added LatencyTracker Added SSL/SSLOptions
- Loading branch information
Showing
8 changed files
with
255 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...java/org/springframework/cassandra/test/integration/config/xml/TestHostStateListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2011-2014 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.springframework.cassandra.test.integration.config.xml; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.datastax.driver.core.Host; | ||
import com.datastax.driver.core.Host.StateListener; | ||
|
||
/** | ||
* @author David Webb | ||
* | ||
*/ | ||
public class TestHostStateListener implements StateListener { | ||
|
||
private final static Logger log = LoggerFactory.getLogger(TestHostStateListener.class); | ||
|
||
@Override | ||
public void onAdd(Host host) { | ||
log.info("Host Added: " + host.getAddress()); | ||
} | ||
|
||
@Override | ||
public void onUp(Host host) { | ||
log.info("Host Up: " + host.getAddress()); | ||
} | ||
|
||
@Override | ||
public void onDown(Host host) { | ||
log.info("Host Down: " + host.getAddress()); | ||
} | ||
|
||
@Override | ||
public void onRemove(Host host) { | ||
log.info("Host Removed: " + host.getAddress()); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...st/java/org/springframework/cassandra/test/integration/config/xml/TestLatencyTracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2011-2014 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.springframework.cassandra.test.integration.config.xml; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.datastax.driver.core.Host; | ||
import com.datastax.driver.core.LatencyTracker; | ||
|
||
/** | ||
* @author David Webb | ||
* | ||
*/ | ||
public class TestLatencyTracker implements LatencyTracker { | ||
|
||
private final static Logger log = LoggerFactory.getLogger(TestLatencyTracker.class); | ||
|
||
@Override | ||
public void update(Host host, long newLatencyNanos) { | ||
log.info("Latency Tracker: " + host.getAddress() + ", " + newLatencyNanos + " nanoseconds."); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters