public static int calculateDataSize(MapStoreConfigHolder config) { int dataSize = ENCODED_BOOLEANS * BOOLEAN_SIZE_IN_BYTES + ENCODED_INTS * INT_SIZE_IN_BYTES; if (config.getProperties() != null) { dataSize += PropertiesCodec.calculateDataSize(config.getProperties()); } dataSize += ParameterUtil.calculateDataSize(config.getInitialLoadMode()); if (config.getClassName() != null) { dataSize += ParameterUtil.calculateDataSize(config.getClassName()); } if (config.getFactoryClassName() != null) { dataSize += ParameterUtil.calculateDataSize(config.getFactoryClassName()); } if (config.getImplementation() != null) { dataSize += ParameterUtil.calculateDataSize(config.getImplementation()); } if (config.getFactoryImplementation() != null) { dataSize += ParameterUtil.calculateDataSize(config.getFactoryImplementation()); } return dataSize; } }
public static int calculateDataSize(MapStoreConfigHolder config) { int dataSize = ENCODED_BOOLEANS * BOOLEAN_SIZE_IN_BYTES + ENCODED_INTS * INT_SIZE_IN_BYTES; if (config.getProperties() != null) { dataSize += PropertiesCodec.calculateDataSize(config.getProperties()); } dataSize += ParameterUtil.calculateDataSize(config.getInitialLoadMode()); if (config.getClassName() != null) { dataSize += ParameterUtil.calculateDataSize(config.getClassName()); } if (config.getFactoryClassName() != null) { dataSize += ParameterUtil.calculateDataSize(config.getFactoryClassName()); } if (config.getImplementation() != null) { dataSize += ParameterUtil.calculateDataSize(config.getImplementation()); } if (config.getFactoryImplementation() != null) { dataSize += ParameterUtil.calculateDataSize(config.getFactoryImplementation()); } return dataSize; } }
public static int calculateDataSize(MapStoreConfigHolder config) { int dataSize = ENCODED_BOOLEANS * BOOLEAN_SIZE_IN_BYTES + ENCODED_INTS * INT_SIZE_IN_BYTES; if (config.getProperties() != null) { dataSize += PropertiesCodec.calculateDataSize(config.getProperties()); } dataSize += ParameterUtil.calculateDataSize(config.getInitialLoadMode()); if (config.getClassName() != null) { dataSize += ParameterUtil.calculateDataSize(config.getClassName()); } if (config.getFactoryClassName() != null) { dataSize += ParameterUtil.calculateDataSize(config.getFactoryClassName()); } if (config.getImplementation() != null) { dataSize += ParameterUtil.calculateDataSize(config.getImplementation()); } if (config.getFactoryImplementation() != null) { dataSize += ParameterUtil.calculateDataSize(config.getFactoryImplementation()); } return dataSize; } }
public static void encode(MapStoreConfigHolder config, ClientMessage clientMessage) { clientMessage.set(config.isEnabled()).set(config.isWriteCoalescing()) .set(config.getWriteDelaySeconds()).set(config.getWriteBatchSize()) .set(config.getInitialLoadMode()); boolean isNullProperties = config.getProperties() == null; clientMessage.set(isNullProperties); if (!isNullProperties) { PropertiesCodec.encode(config.getProperties(), clientMessage); } boolean isNullClassName = config.getClassName() == null; clientMessage.set(isNullClassName); if (!isNullClassName) { clientMessage.set(config.getClassName()); } boolean isNullFactoryClassName = config.getFactoryClassName() == null; clientMessage.set(isNullFactoryClassName); if (!isNullFactoryClassName) { clientMessage.set(config.getFactoryClassName()); } boolean isNullImplementation = config.getImplementation() == null; clientMessage.set(isNullImplementation); if (!isNullImplementation) { clientMessage.set(config.getImplementation()); } boolean isNullFactoryImplementation = config.getFactoryImplementation() == null; clientMessage.set(isNullFactoryImplementation); if (!isNullFactoryImplementation) { clientMessage.set(config.getFactoryImplementation()); } }
public static void encode(MapStoreConfigHolder config, ClientMessage clientMessage) { clientMessage.set(config.isEnabled()).set(config.isWriteCoalescing()) .set(config.getWriteDelaySeconds()).set(config.getWriteBatchSize()) .set(config.getInitialLoadMode()); boolean isNullProperties = config.getProperties() == null; clientMessage.set(isNullProperties); if (!isNullProperties) { PropertiesCodec.encode(config.getProperties(), clientMessage); } boolean isNullClassName = config.getClassName() == null; clientMessage.set(isNullClassName); if (!isNullClassName) { clientMessage.set(config.getClassName()); } boolean isNullFactoryClassName = config.getFactoryClassName() == null; clientMessage.set(isNullFactoryClassName); if (!isNullFactoryClassName) { clientMessage.set(config.getFactoryClassName()); } boolean isNullImplementation = config.getImplementation() == null; clientMessage.set(isNullImplementation); if (!isNullImplementation) { clientMessage.set(config.getImplementation()); } boolean isNullFactoryImplementation = config.getFactoryImplementation() == null; clientMessage.set(isNullFactoryImplementation); if (!isNullFactoryImplementation) { clientMessage.set(config.getFactoryImplementation()); } }
public static void encode(MapStoreConfigHolder config, ClientMessage clientMessage) { clientMessage.set(config.isEnabled()).set(config.isWriteCoalescing()) .set(config.getWriteDelaySeconds()).set(config.getWriteBatchSize()) .set(config.getInitialLoadMode()); boolean isNullProperties = config.getProperties() == null; clientMessage.set(isNullProperties); if (!isNullProperties) { PropertiesCodec.encode(config.getProperties(), clientMessage); } boolean isNullClassName = config.getClassName() == null; clientMessage.set(isNullClassName); if (!isNullClassName) { clientMessage.set(config.getClassName()); } boolean isNullFactoryClassName = config.getFactoryClassName() == null; clientMessage.set(isNullFactoryClassName); if (!isNullFactoryClassName) { clientMessage.set(config.getFactoryClassName()); } boolean isNullImplementation = config.getImplementation() == null; clientMessage.set(isNullImplementation); if (!isNullImplementation) { clientMessage.set(config.getImplementation()); } boolean isNullFactoryImplementation = config.getFactoryImplementation() == null; clientMessage.set(isNullFactoryImplementation); if (!isNullFactoryImplementation) { clientMessage.set(config.getFactoryImplementation()); } }