ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: OptimizedClassDescriptor verifyChecksum object set as optional
Date Mon, 09 Nov 2015 14:22:04 GMT
Hi,

As I understand both servers have different implementations but the 
names of those implementations are the same, correct?
Because otherwise I don't see how your code could get to the point of 
checksum validation if one implementation's name is ServiceEntity while 
the other's is DataEntity.

If my assumptions above are correct then I would recommend to do the 
following:

1) Extend Serializable instead of Externalizable

interface Entity extends Serializable {
     .....
}

2) Add custom serialVersionUID to each implementation. This will help 
you get rid off checksum related exception

class EntityImpl implements Entity {

private static final long serialVersionUID =0L;

......
}


Regards,
Denis

On 11/8/2015 3:27 PM, 姜 为 wrote:
> Hi guys:
>
> 	I’m using ignite 1.4.
> 	In IgniteCompute.call will transfer of an object to the cluster.
>      The object should implement Serializable or Externalizable interface.
>      OptimizedClassDescriptor.read method will check whether the object is in the same
class.
>
>      In my use case,I have some type of servers in cluster.
>      The server type A will check the business,and the server type B will persistent
data.
>      There is a entity interface Entity extends Externalizable have different implementations
on different servers.
>      Such like this:
>
>      interface Entity extends Externalizable {
> 	method a();
> 	method b();
> 		method c();
> 	}
>
> 	class  ServiceEntity implements Entity {
> 	method a(){
> 		// do something...
> 	}
>
> 	method b(){
> 		// do something...
> 	}
>
> 	method c(){
> 		throw new UnsupportedException...
> 	}
>
> 	Externalizable.read...
> 	Externalizable.write...
>      }
>
>      class DataEntity implements Entity {
> 	method a(){
> 		// do something...
> 	}
>
> 	method b(){
> 		throw new UnsupportedException...
> 	}
>
> 	method c(){
> 		// do something...
> 	}
>
> 	Externalizable.read...
> 	Externalizable.write...
>      }
>
>
>      And IgniteCompute.call(new IgniteCallable(
> 		public Object call(){
> 			Entity.a() or b and c;..
> 		}
> 	));
>
>     Different implementations of the same class are to achieve read and write methods.
>     But OptimizedClassDescriptor.read will check the class sum and throw ClassNotFoundException.
>
>     I recommend verifyChecksum object set as optional,and I really need is change.
>
>     Here is my pr:
>     https://issues.apache.org/jira/browse/IGNITE-1854 <https://issues.apache.org/jira/browse/IGNITE-1854>
>        https://github.com/apache/ignite/pull/200/ <https://github.com/apache/ignite/pull/200/>
>
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message