flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Tadose <ashishtad...@gmail.com>
Subject Not able to query : Queryable State
Date Wed, 31 Aug 2016 10:39:36 GMT
Hi Flink community,

I have been trying to use QueryableState with my project.
It's always failing the query saying.

Job 461acde52fae479a6e02c6b2922cd9c1 not found


Both keys(one in queryablestate and one in query) are of same type containing same data.
Still I am not able to fetch the result.
Type of key Class :

case class Record(val fields: Seq[String], val ab: Double = 0.0, val cd: Double = 0.0, val
count: Long = 0) extends Serializable with Addable[Record] with Comparable[Record]{

 override def +(other: Record) = {
   new Record(fields,
     ab + other.ab,
     cd + other.cd,
     count + other.count)
 }

 override def equals(obj: scala.Any): Boolean = {
   obj match {
     case other: Record => fields == other.fields
     case _ => false
   }
 }

 override def hashCode(): Int = {
   var hashCode = 0
   fields.foreach(x => hashCode= hashCode+ 31 * x.hashCode)
//    Math.abs(hashCode)
   hashCode
 }

 override def compareTo(o: Record): Int = {
     var i = 0
     i = i + (count - o.count).toInt
     i = i+ (ab - o.ab).toInt
     i = i+ (cd - o.cd).toInt
     return i
 }
}

Is there problem with serialization? 
Can I not use complex object as key (it is implementing comparable)

Thanks,
Ashish
Mime
View raw message