Page tree
Skip to end of metadata
Go to start of metadata

Supported Libraries

Supported Operations

OperationsMethod Supported
Insert
 spymemcached 2.7.1
  • net.spy.memcached.MemcachedClient.set
  • net.spy.memcached.MemcachedClient.add
Update
 spymemcached 2.7.1
  • 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
 spymemcached 2.7.1
  • net.spy.memcached.MemcachedClient.get
  • net.spy.memcached.MemcachedClient.asyncGet
  • net.spy.memcached.MemcachedClient.getBulk

  • net.spy.memcached.MemcachedClient.asyncGetBulk

Delete
 spymemcached 2.7.1
  • 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

.

 Connection Creation - IP Address

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));
		  
	}
}


 Connection Creation - HostName

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 Creation

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

 Insert Operation
 set command
mcc.set("tp", 900, "memcached").isDone()

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

 Select Operation
 get command
mcc.get("data2")

 ayncGet command
mcc.asyncGet("data2")

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

 Delete Operation
 delete command
mcc.delete("data1").isDone()

 Update Operation
 replace command
mcc.replace("tp", 900, "redis").isDone()

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

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

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

  • No labels