Software Defined Networking
1754020 Members
7288 Online
108811 Solutions
New Discussion юеВ

Persistent Storage

 
SOLVED
Go to solution
ssrirama
Advisor

Persistent Storage

Anyone have an app that uses the persistent storage libraries? I see facilities for encoding and decoding objects but I'm not sure what the code is for actually telling the controller to persistent store something.

10 REPLIES 10
Carlos
Frequent Advisor

Re: Persistent Storage

Ssrirama,

 

I will get back to you since I will need to research this.

 

Best Regards,

 

Carlos

CoE SDN Team

ssrirama
Advisor

Re: Persistent Storage

Sounds good, thanks for looking into this.

Carlos
Frequent Advisor

Re: Persistent Storage

Ssrirama,

 

This is the information I was able to gathered:

 

 The VAN SDN controller uses Apache Cassandra for persistent storage (cassandra.apache.org). Cassanda uses a commit log method to maintain database integrity тАУ basically data being written is first appended to a commitlog. This log is rapidly flushed from write-behind cache to disk and then the database is updated -  similar to SQL Server, Oracle, etc.

 

  You can find a developer walk-through for writing/reading the database at www.planetcassandra.org/try-cassandra/

 

You can also check the HP VAN SDN Controller 2.5 Administrator Guide pages 22 and 39.

 

Let me know if the above information is what you were looking for?

 

Best Regards,

 

Carlos

ssrirama
Advisor

Re: Persistent Storage

So clarify this for me, if I want to use to the Cassandra database to store my application data, is the Javadoc for Cassandra independent of the HP SDN SDK? If the libraries are in the HP SDN SDK and the javadoc is in the API Javadoc, can you provide the path to the library? E.g. "import org.apache.x.x"

 

The video walkthrough you provided was very useful since I haven't worked with Cassandra before, but ultimately I am interested in the code...in the (Java) programmatic interaction with Cassandra. I don't know where to find the methods and classes I need in the API.

ssrirama
Advisor

Re: Persistent Storage

Ideally, I'd like to see some sample code that uses Cassandra for persistent storage.

Carlos
Frequent Advisor

Re: Persistent Storage

Ssrirama,

 

One of my coleauges provided me with this information:

 

 

  The VAN SDN Controller uses a Data Access Object (DAO) to interface with Cassandra.

 

  The controller software is packaged in a zip file that includes the developer kit files (hp-sdn-sdk-2.5.15.zip). Inside the SDK zip file, java templates for some persistence layer DAO methods can be found. For example, the java code for the Cassandra QueryManager DAO is in lib/templates/persistence/dao. QueryManager.java is attached for your reference. There is also a dao-api folder in the zip file which defines a basic interface for persistence layer queries (Cassandra database read and write operations).

 

There is a good explanation of the persistence subsystem beginning on page 79 of the attached pdf (VAN SDN Controller Programmers Guide).

 

Best Regards,

 

Carlos

 

CoE SDN Team

 

ssrirama
Advisor

Re: Persistent Storage

Does this code seem right in terms of having something stored with Cassandra and then fetched and written to log?

 

	try {
		CassandraStorable<String, String> storable = new CassandraStorable<String, String>("Some ID");
		storable.setColumn(new StringColumn<String>(ColumnName.valueOf("Some Data"), "This is a test"));
		logger.info("Cassandra info stored was " + storable.getColumn(ColumnName.valueOf("Some Data")).getValue());
	} catch (Exception e1) {
		e1.printStackTrace();
	}
ssrirama
Advisor

Re: Persistent Storage

What concerns me about that previous piece of code is that at compile time, Maven doesn't recognize Cassandra.

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sdn-sbyod: Compilation failure: Compilation failure:
[ERROR] /home/ssrirama/sdn-sbyod/sbyod-bl/src/main/java/com/omitted/sbyod/SecureBYODManager.java:[40,50] error: package com.hp.util.persistence.cassandra.entitymgr does not exist
[ERROR] /home/ssrirama/sdn-sbyod/sbyod-bl/src/main/java/com/omitted/sbyod/SecureBYODManager.java:[41,57] error: package com.hp.util.persistence.cassandra.entitymgr.column does not exist
[ERROR] /home/ssrirama/sdn-sbyod/sbyod-bl/src/main/java/com/omitted/sbyod/SecureBYODManager.java:[42,57] error: package com.hp.util.persistence.cassandra.entitymgr.column does not exist

Why isn't it able to resolve the persistence libraries?

 

Carlos
Frequent Advisor
Solution

Re: Persistent Storage

Ssrirama,

 

It seems the system didn't post my post. But, the information you requested is not something that we in the HP FORUM support. If you need this kind of support you will need to open a case with HP Support and it will be fee based.

 

Best Regards,

 

Carlos

 

CoE SDN team.