prabhatbhattarai / project-voldemort

Automatically exported from code.google.com/p/project-voldemort
Apache License 2.0
0 stars 0 forks source link

StoreDefinitionsMapper.viewToElement() generates bogus XML when target store uses Zone Routing #351

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Create a view of a store that uses Zone routing. Make sure zone-read-count and 
zone-write-count are specified in the store definition.

What is the expected output? What do you see instead?

When serializing the stores.xml file the view definitions are incorrect -- the 
view name & class are missing.

What version of the product are you using? On what operating system?

0.94 (li-r1124)

Please provide any additional information below.

The following diff fixes the problem:

diff --git a/src/java/voldemort/xml/StoreDefinitionsMapper.java 
b/src/java/voldemort/xml/StoreDefinitionsMapper.jav
index 5ff1250..6432f7a 100644
--- a/src/java/voldemort/xml/StoreDefinitionsMapper.java
+++ b/src/java/voldemort/xml/StoreDefinitionsMapper.java
@@ -487,11 +487,11 @@ public class StoreDefinitionsMapper {
         store.addContent(new Element(STORE_REQUIRED_WRITES_ELMT).setText(Integer.toString(storeDefinition.getRequi

         if(storeDefinition.hasZoneCountReads())
-            store.addContent(new Element(STORE_ZONE_COUNT_READS))
-                 
.setText(Integer.toString(storeDefinition.getZoneCountReads()));
+            store.addContent(new Element(STORE_ZONE_COUNT_READS)
+                 
.setText(Integer.toString(storeDefinition.getZoneCountReads())));
         if(storeDefinition.hasZoneCountWrites())
-            store.addContent(new Element(STORE_ZONE_COUNT_WRITES))
-                 
.setText(Integer.toString(storeDefinition.getZoneCountWrites()));
+            store.addContent(new Element(STORE_ZONE_COUNT_WRITES)
+                 
.setText(Integer.toString(storeDefinition.getZoneCountWrites())));

         Element valueSerializer = new Element(STORE_VALUE_SERIALIZER_ELMT);
         addSerializer(valueSerializer, storeDefinition.getValueSerializer());

Original issue reported on code.google.com by neale.pa...@gmail.com on 10 Jun 2011 at 7:42

GoogleCodeExporter commented 8 years ago
Great catch! Checked it into my master. Will merge it to trunk in some time...

Original comment by rsumb...@gmail.com on 22 Jun 2011 at 12:58