StorageEngine<ByteArray, byte[], byte[]> target = storeRepo.getStorageEngine(targetName);
if(target == null)
throw new VoldemortException("View \"" + name + "\" has a target store \"" + targetName
+ "\" which does not exist.");
String factoryName = def.getSerializerFactory();
SerializerFactory factory;
if(factoryName == null)
factory = new DefaultSerializerFactory();
else
factory = loadSerializerFactory(factoryName);
CompressionStrategy valueCompressionStrategy = null;
if(targetDef.getValueSerializer().hasCompression()) {
valueCompressionStrategy = new CompressionStrategyFactory().get(targetDef.getValueSerializer()
.getCompression());
}
View<?, ?, ?, ?> view = loadTransformation(def.getValueTransformation());
return new ViewStorageEngine(name,
target,
factory.getSerializer(def.getValueSerializer()),
def.getTransformsSerializer() != null ? factory.getSerializer(def.getTransformsSerializer())
: null,
factory.getSerializer(targetDef.getKeySerializer()),
factory.getSerializer(targetDef.getValueSerializer()),
valueCompressionStrategy,
view);
}