Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

message fixes, deprecated core:auto

  • Loading branch information...
commit bbfbd50bfca3842be2aaab4c05a7b912715346c7 1 parent e6f4f95
@mjpearson authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/Core.class.php
View
14 lib/Core.class.php
@@ -300,6 +300,13 @@ static public function registerError($errorMsg, $priority = PandraLog::LOG_WARNI
}
/**
+ * Alias for connectBySeed (deprecated)
+ */
+ static public function auto($host, $poolName = self::DEFAULT_POOL_NAME, $port = THRIFT_PORT_DEFAULT) {
+ return self::connectBySeed($host, $poolName, $port);
+ }
+
+ /**
* Given a single host, attempts to find other nodes in the cluster and attaches them
* to the pool
* @todo build connections from token map
@@ -308,7 +315,7 @@ static public function registerError($errorMsg, $priority = PandraLog::LOG_WARNI
* @param int $port TCP port of connecting node
* @return bool connected ok
*/
- static public function auto($host, $poolName = self::DEFAULT_POOL_NAME, $port = THRIFT_PORT_DEFAULT) {
+ static public function connectBySeed($host, $poolName = self::DEFAULT_POOL_NAME, $port = THRIFT_PORT_DEFAULT) {
try {
// Create Thrift transport and binary protocol cassandra client
@@ -396,8 +403,9 @@ static public function getClient($writeMode = FALSE) {
// Catch trimmed nodes or a completely trimmed pool
if (empty(self::$_activeNode) || empty(self::$_socketPool[self::$_activePool])) {
- self::registerError('Not Connected', PandraLog::LOG_CRIT);
- throw new Exception('Not Connected');
+ $err = 'Could not connect to Cassandra Server';
+ self::registerError($err, PandraLog::LOG_CRIT);
+ throw new Exception($err);
}
$activePool = self::$_socketPool[self::$_activePool];
Please sign in to comment.
Something went wrong with that request. Please try again.