Supported Libraries
Supported Operations
Operations | Method Supported |
---|---|
Insert |
|
Update |
|
Select |
|
Delete |
|
Objects
Icon | Description |
---|---|
| 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 type | Source and destination of link | Methods Supported |
---|---|---|
belongsTo | From Memcached data object to Memcached connection object | |
useInsertLink | Between the java Method objects and Memcached data object |
|
useUpdateLink |
| |
useSelectLink |
| |
useDeleteLink |
|
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); } }
Insert Operation for various Memcached Data
With set() command
mcc.set("tp", 900, "memcached").isDone()
With add() command
mcc.add("data3", 900, "redis").isDone()
Unknown data objects
mcc.add(Connection1.data_val, 900, "redis").isDone();
Select Operation for various Memcached Data
With get()
mcc.get("data2")
With asyncGet()
mcc.asyncGet("data2")
Delete Operation for various Memcached Data
mcc.delete("data1").isDone()
Update Operation for various Memcached Data
With replace()
mcc.replace("tp", 900, "redis").isDone()
With append() and prepend()
mcc.append(900, "tp", "redis").isDone(); mcc.prepend(900, "tp", "redis").isDone();
With increment (incr()) and decrement(decr())
// incrementing the numeric value of existing key mcc.incr("tp", 2)); //decrementing the numeric value of existing key mcc.decr("tp", 1));
With asyncIncr() and asyncDecr()
mcc.asyncIncr("tp", 2); mcc.asyncDecr("tp", 1);
Limitations
- Supports only "SpyMemcached" library.