Commit 1d850208 by Harish Butani

make GraphPersistenceStrategies interface java friendly

parent e2f14301
...@@ -26,7 +26,7 @@ import org.apache.hadoop.metadata.query.Expressions.{ExpressionException, Compar ...@@ -26,7 +26,7 @@ import org.apache.hadoop.metadata.query.Expressions.{ExpressionException, Compar
import org.apache.hadoop.metadata.query.TypeUtils.FieldInfo import org.apache.hadoop.metadata.query.TypeUtils.FieldInfo
import org.apache.hadoop.metadata.storage.Id import org.apache.hadoop.metadata.storage.Id
import org.apache.hadoop.metadata.types._ import org.apache.hadoop.metadata.types._
import scala.collection.JavaConversions._
/** /**
* Represents the Bridge between the QueryProcessor and the Graph Persistence scheme used. * Represents the Bridge between the QueryProcessor and the Graph Persistence scheme used.
...@@ -63,7 +63,7 @@ trait GraphPersistenceStrategies { ...@@ -63,7 +63,7 @@ trait GraphPersistenceStrategies {
* @param v * @param v
* @return * @return
*/ */
def traitNames(v : TitanVertex) : Seq[String] def traitNames(v : TitanVertex) : java.util.List[String]
def edgeLabel(fInfo : FieldInfo) : String = fInfo match { def edgeLabel(fInfo : FieldInfo) : String = fInfo match {
case FieldInfo(dataType, aInfo, null) => edgeLabel(dataType, aInfo) case FieldInfo(dataType, aInfo, null) => edgeLabel(dataType, aInfo)
...@@ -80,7 +80,7 @@ trait GraphPersistenceStrategies { ...@@ -80,7 +80,7 @@ trait GraphPersistenceStrategies {
*/ */
def getIdFromVertex(dataTypeNm : String, v : TitanVertex) : Id def getIdFromVertex(dataTypeNm : String, v : TitanVertex) : Id
def constructInstance[U](dataType : IDataType[U], v : AnyRef) : U def constructInstance[U](dataType : IDataType[U], v : java.lang.Object) : U
def gremlinCompOp(op : ComparisonExpression) = op.symbol match { def gremlinCompOp(op : ComparisonExpression) = op.symbol match {
case "=" => "T.eq" case "=" => "T.eq"
...@@ -108,7 +108,7 @@ object GraphPersistenceStrategy1 extends GraphPersistenceStrategies { ...@@ -108,7 +108,7 @@ object GraphPersistenceStrategy1 extends GraphPersistenceStrategies {
def getIdFromVertex(dataTypeNm : String, v : TitanVertex) : Id = def getIdFromVertex(dataTypeNm : String, v : TitanVertex) : Id =
new Id(v.getId.toString, 0, dataTypeNm) new Id(v.getId.toString, 0, dataTypeNm)
def traitNames(v : TitanVertex) : Seq[String] = { def traitNames(v : TitanVertex) : java.util.List[String] = {
val s = v.getProperty[String]("traitNames") val s = v.getProperty[String]("traitNames")
if ( s != null ) { if ( s != null ) {
Seq[String](s.split(","):_*) Seq[String](s.split(","):_*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment