Oracle 5.0 Reference Manual page 1397

Table of Contents

Advertisement

The remainder of the properties for the connection are optional, but you can set the connection
numbers (initial connections, minimum connections, maximum connections, and the idle timeout) by
setting the pool parameters:
pool.setInitConn( 5 );
pool.setMinConn( 5 );
pool.setMaxConn( 250 );
pool.setMaxIdle( 1000 * 60 * 60 * 6
Once the parameters have been configured, initialize the connection pool:
pool.initialize();
The pool, and the connection to your
To set the hashing algorithm used to select the server used when storing a given key, use
pool.setHashingAlg():
pool.setHashingAlg( SockIOPool.NEW_COMPAT_HASH );
Valid values are NEW_COMPAT_HASH,
hashing algorithms. For a consistent hashing algorithm, use CONSISTENT_HASH. These constants are
equivalent to the corresponding hash settings within libmemcached.
The following table outlines the Java
methods in the
Java
com.danga.MemCached
get()
getMulti(keys)
set()
add()
replace()
delete()
incr()
decr()
15.6.3.9. Using the
Communicating with a
When using the TCP protocol, you can use a simple text based interface for the exchange of
information.
When communicating with memcached, you can connect to the server using the port configured for the
server. You can open a connection with the server without requiring authorization or login. As soon as
you have connected, you can start to send commands to the server. When you have finished, you can
terminate the connection without sending any specific disconnection command. Clients are encouraged
to keep their connections open to decrease latency and improve performance.
Data is sent to the
• Text lines, which are used to send commands to the server, and receive responses from the server.
• Unstructured data, which is used to receive or send the value information for a given key. Data is
returned to the client in exactly the format it was provided.
Developing a
interface specification.
memcached
Method
TCP Text Protocol
memcached
server can be achieved through either the TCP or UDP protocols.
memcached
server in two forms:
memcached
Application
memcached
instances should now be ready to use.
memcached
and
OLD_COMPAT_HASH
com.danga.MemCached
Equivalent Generic Method
Generic get().
Get the values of multiple keys, returning
the information as Hash map using
java.lang.String
java.lang.Object
values.
Generic set().
Generic add().
Generic replace().
Generic delete().
Generic incr().
Generic decr().
1377
are also basic modula
NATIVE_HASH
methods and the equivalent generic
for the keys and
for the corresponding

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents