Permalink
Browse files

Remove deprecated ConnPool methods status and recreate

  • Loading branch information...
1 parent 42ebc08 commit c4ae4f39a630de7881b76ec47fdb812216c56047 @thobbs thobbs committed Jan 23, 2012
Showing with 3 additions and 50 deletions.
  1. +0 −44 pycassa/pool.py
  2. +3 −6 tests/test_connection_pooling.py
View
@@ -5,7 +5,6 @@
import random
import socket
import Queue
-import warnings
from thrift import Thrift
from connection import Connection
@@ -419,31 +418,6 @@ def fill(self):
finally:
self._pool_lock.release()
- def recreate(self):
- """
- Returns a new instance with idential creation arguments. This method
- does *not* affect the object it is called on.
-
- .. deprecated:: 1.2.0
- """
- msg = "ConnectionPool.recreate() has been deprecated."
- warnings.warn(msg, DeprecationWarning)
-
- self._notify_on_pool_recreate()
- return ConnectionPool(pool_size=self._q.maxsize,
- max_overflow=self._max_overflow,
- pool_timeout=self.pool_timeout,
- keyspace=self.keyspace,
- server_list=self.server_list,
- credentials=self.credentials,
- timeout=self.timeout,
- recycle=self.recycle,
- max_retries=self.max_retries,
- prefill=self._prefill,
- logging_name=self.logging_name,
- use_threadlocal=self._pool_threadlocal,
- listeners=self.listeners)
-
def _get_new_wrapper(self, server):
return ConnectionWrapper(self, self.max_retries,
self.keyspace, server,
@@ -587,24 +561,6 @@ def dispose(self):
self._overflow = 0 - self.size()
self._notify_on_pool_dispose()
- def status(self):
- """
- Returns the status of the pool.
-
- .. deprecated:: 1.2.0
- """
- msg ="ConnectionPool.status() is deprecated, use " +\
- "ConnectionPool.size(), checkedin(), overflow(), " +\
- "and checkedout() instead."
- warnings.warn(msg, DeprecationWarning)
-
- return "Pool size: %d, connections in pool: %d, "\
- "current overflow: %d, current checked out "\
- "connections: %d" % (self.size(),
- self.checkedin(),
- self.overflow(),
- self.checkedout())
-
def size(self):
""" Returns the capacity of the pool. """
return self._pool_size
@@ -2,12 +2,9 @@
import unittest
import time
-from nose.tools import assert_raises, assert_equal, assert_not_equal
+from nose.tools import assert_raises, assert_equal
from pycassa import ColumnFamily, ConnectionPool, PoolListener, InvalidRequestError,\
- NoConnectionAvailable, MaximumRetryException, AllServersUnavailable
-
-import pycassa.pool
-from pycassa.cassandra.ttypes import TimedOutException
+ NoConnectionAvailable, MaximumRetryException
_credentials = {'username':'jsmith', 'password':'havebadpass'}
@@ -26,7 +23,6 @@ def test_basic_pools(self):
pool = ConnectionPool('PycassaTestKeyspace', credentials=_credentials)
cf = ColumnFamily(pool, 'Standard1')
cf.insert('key1', {'col':'val'})
- pool.status()
pool.dispose()
def test_server_list_func(self):
@@ -35,6 +31,7 @@ def test_server_list_func(self):
listeners=[listener], prefill=False)
assert_equal(listener.serv_list, ['foo:bar'])
assert_equal(listener.list_count, 1)
+ pool.dispose()
def test_queue_pool(self):
listener = _TestListener()

0 comments on commit c4ae4f3

Please sign in to comment.