Oracle 5.0 Reference Manual page 1396

Table of Contents

Advertisement

Or to retrieve the value:
print memc["key"]
For more explicit actions, you can use the method interface, which mimics the main
functions, as summarized in the following table:
Ruby
MemCache
get()
get_hash(keys)
set()
set_many(pairs)
add()
replace()
delete()
incr()
decr()
15.6.3.8. Using MySQL and
The
com.danga.MemCached
You can obtain the client from http://whalin.com/memcached/. The Java class uses hashes that are
compatible with libmemcached, so you can mix and match Java and
accessing the same
not compatible. If this is a problem, use JSON or a similar nonbinary serialization format.
On most systems, you can download the package and use the
To use the
com.danga.MemCached
configure the list of servers by configuring the SockIOPool. Through the pool specification you set up
the server list, weighting, and the connection parameters to optimized the connections between your
client and the
Generally, you can configure the
interface throughout the rest of your application.
For example, to create a basic interface, first configure the
SockIOPool
public class MyClass {
protected static MemCachedClient mcc = new MemCachedClient();
static {
String[] servers =
Integer[] weights = { 1 };
SockIOPool pool = SockIOPool.getInstance();
pool.setServers( servers );
pool.setWeights( weights );
In the above sample, the list of servers is configured by creating an array of the
to use. You can then configure individual weights for each server.
Developing a
Method
memcached
class within Java provides a native interface to
instances. The serialization between Java and other interfaces are
memcached
instances that you configure.
memcached
memcached
settings:
{
"localhost:11211",
};
Application
memcached
Equivalent
Generic get().
Get the values of multiple keys, returning the
information as a hash of the keys and their values.
Generic set().
Set the values of the keys and values in the hash
pairs.
Generic add().
Generic replace().
Generic delete().
Generic incr().
Generic decr().
with Java
interface, you create a
interface once within a single class, then use this
MemCachedClient
1376
API Functions
memcached
memcached
libmemcached
directly.
jar
instance and then
MemCachedClient
and base
memcached
API
memcached
instances.
applications
instances

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents