ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rishi007bansod <rishi007ban...@gmail.com>
Subject Binarylizable interface in apache ignite
Date Fri, 18 Nov 2016 11:56:31 GMT
I am trying to use Binarylizable interface in apache ignite for reducing
memory utilization(for compact representation of data). Following is data
class that I have made binarylizable.

class order_line implements Binarylizable{  
	@QuerySqlField(index = true)
	int ol_o_id; 
	@QuerySqlField(index = true)
	int ol_d_id;
	@QuerySqlField(index = true)
	int ol_w_id;
	@QuerySqlField(index = true)
	int ol_number;
	int ol_i_id; 
	int ol_supply_w_id;
	String ol_delivery_d;
	int ol_quantity;
	double ol_amount;
	String ol_dist_info;
	private order_lineKey key;
	public order_lineKey key()
		if(key == null)
			key = new order_lineKey(ol_w_id, ol_d_id, ol_o_id, ol_number);
		return key;
	public void readBinary(BinaryReader reader) throws BinaryObjectException {
		// TODO Auto-generated method stub
		ol_o_id = reader.readInt("ol_o_id");
		ol_d_id = reader.readInt("ol_d_id");
		ol_w_id = reader.readInt("ol_w_id");
		ol_number = reader.readInt("ol_number");
		ol_i_id = reader.readInt("ol_i_id");
		ol_supply_w_id = reader.readInt("ol_supply_w_id");
		ol_delivery_d = reader.readString("ol_delivery_d");		
		ol_quantity = reader.readInt("ol_quantity");
		ol_amount = reader.readDouble("ol_amount");
		ol_dist_info = reader.readString("ol_dist_info");
	public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
		// TODO Auto-generated method stub
		writer.writeDouble("ol_amount", ol_amount);


Is this the correct way for compact binary representation of data? Because I
am not getting any improvement in memory consumption after using this
interface. Also, in readBinary() and writeBinary() methods do we have to
write writer.writeInt/String/Double and reader.readInt/String/Double methods
for every field or only fields participating in SQL queries(Does this have
any effect on memory consumption)?  

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Binarylizable-interface-in-apache-ignite-tp9078.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message