Page tree

Supported Libraries

LibraryVersion Supported
spymemcachedUp to: 2.7.1     (tick)

Supported Operations

OperationsMethod Supported
Insert
  • net.spy.memcached.MemcachedClient.set
  • net.spy.memcached.MemcachedClient.add
Update
  • net.spy.memcached.MemcachedClient.incr
  • net.spy.memcached.MemcachedClient.asyncIncr
  • net.spy.memcached.MemcachedClient.decr
  • net.spy.memcached.MemcachedClient.asyncDecr
  • net.spy.memcached.MemcachedClient.replace
  • net.spy.memcached.MemcachedClient.append
  • net.spy.memcached.MemcachedClient.prepend 
  • net.spy.memcached.MemcachedClient.getAndLock
  • net.spy.memcached.MemcachedClient.getAndTouch
  • net.spy.memcached.MemcachedClient.asyncGetAndTouch
  • net.spy.memcached.MemcachedClient.asyncGetAndLock
Select
  • net.spy.memcached.MemcachedClient.get
  • net.spy.memcached.MemcachedClient.asyncGet
  • net.spy.memcached.MemcachedClient.getBulk

  • net.spy.memcached.MemcachedClient.asyncGetBulk

Delete
  • net.spy.memcached.MemcachedClient.delete

Objects

IconDescription

Java Memcached Connection

Java Memcached Data

Java Unknown Memcached Connection

Java Unknown Memcached Data

Links

Links are created for transaction and function point needs:

Link typeSource and destination of link Methods Supported
belongsToFrom Memcached data object to Memcached connection object
useInsertLinkBetween the java Method objects and Memcached data object
  • Insert
useUpdateLink
  • Increment
  • Decrement
  • Append
  • Prepend 
  • CAS
  • asyncCAS
  • getAndLock
  • getAndTouch
  • asyncGetAndTouch
  • asyncGetAndLock
useSelectLink
  • Get
  • GetAsync
  • getBulk
  • asyncGetBulk
  • CAS
  • asyncCAS
  • getAndLock
  • getAndTouch
  • asyncGetAndTouch
  • asyncGetAndLock
useDeleteLink
  • Remove

What results can you expect?

Once the analysis/snapshot generation is completed, you can view the results in the normal manner (for example via CAST Enlighten). Some examples are shown below.

Memcached Connection

.

In the Memcached class file, when we add the server information by parsing the IP address and provide the port Number. Below is a sample source code with its result in Enlighten 

public class Connection {
	
	public static void main(String[] args) throws IOException {
	     

		  MemcachedClient mcc = new MemcachedClient(new InetSocketAddress("127.0.0.1", 11211));
		  
	}
}


In the Memcached class file, when we add the set of server information by parsing the server address and provide the port Number over the binary connection protocol. Below is a sample source code with its result in Enlighten

public class Connection {
	
	public static void main(String[] args) throws IOException {

			MemcachedClient mcc1 = new MemcachedClient(new BinaryConnectionFactory(), AddrUtil.getAddresses
	    		  				("server1"));
	}
}


Unknown Connection Object: In the Memcached class file, when we pass the server information as a parameter but if passed parameter are unresolved. Below is a sample source code with its result in Enlighten :

	public class Connection {
	
		public static void main(String[] args) throws IOException {

		  	InetSocketAddress inet2 = new InetSocketAddress(Connection1.var, 11211);
  
	     	 MemcachedClient mcc = new MemcachedClient(inet2);
		}
}

CRUD Operations

mcc.set("tp", 900, "memcached").isDone()

mcc.add("data3", 900, "redis").isDone()

mcc.get("data2")

mcc.asyncGet("data2")

m = mcc1.getBulk(keySet);
vals = mcc1.asyncGetBulk(keySet);

mcc.delete("data1").isDone()

mcc.replace("tp", 900, "redis").isDone()

mcc.append(900, "tp", "redis").isDone();
mcc.prepend(900, "tp", "redis").isDone();

// incrementing the numeric value of existing key   
mcc.incr("tp", 2));
mcc.asyncIncr("tp", 2);

//decrementing the numeric value of existing key 
mcc.decr("tp", 1));
mcc.asyncDecr("tp", 1);

Limitations

  • If the Data name is not resolved in the CRUD API, then the link will be created with an unknown Memcached data object
  • No labels