---------- Forwarded message ----------
From: Pushpendra Jaiswal <pushpendra.jaiswa...@gmail.com>
Date: Wed, Aug 31, 2016 at 3:52 PM
Subject: Not able to query : Queryable State
To: user@flink.apache.org


Hi
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 and Regards
Pushpendra Jaiswal

Reply via email to