JigDFS Plugin Change id strings of plugin and codec. rename parameter packetsize...
authorMaximilian Quellmalz <maximilian.quellmalz@mailbox.tu-dresden.de>
Mon, 3 Nov 2014 13:55:49 +0000 (14:55 +0100)
committerMaximilian Quellmalz <maximilian.quellmalz@mailbox.tu-dresden.de>
Mon, 3 Nov 2014 13:55:49 +0000 (14:55 +0100)
Splitter-ng-plugin-jigdfs/src/jigdfsplugin/CodecJigDFS.java
Splitter-ng-plugin-jigdfs/src/jigdfsplugin/SplitterPluginJigDFS.java
Splitter-ng-test/src/SplitterTest.java

index 0005b48..3cf1394 100644 (file)
@@ -20,8 +20,8 @@ import splitterng.plugin.CodecDescription;
 import splitterng.plugin.interfaces.SplitterCodec;
 
 public class CodecJigDFS implements SplitterCodec {
-       public final static String codecID = "JigDFScodec";
-       public final static String codecName = "JigDFS Codec";
+       public final static String codecID = "crs";
+       public final static String codecName = "JigDFS CRS Codec";
        public final static String codecDescriptionText = "Dieser Codec verwendet JigDFS";
        public final static Map <String, Integer []> codecParameterMinMax;
        static {
@@ -29,7 +29,7 @@ public class CodecJigDFS implements SplitterCodec {
                Map <String, Integer []> tmpMap = new HashMap<String, Integer[]>();
                tmpMap.put("k", new Integer[] {new Integer(1),new Integer(1)});
                tmpMap.put("m", new Integer[] {new Integer(1),new Integer(1)});
-               tmpMap.put("packetsize", new Integer[] {new Integer(1),new Integer(4096)});
+               tmpMap.put("chunksize", new Integer[] {new Integer(1),new Integer(4096)});
                // Weitere Parameter hier einfügen und deren Grenzen festlegen
                codecParameterMinMax  = Collections.unmodifiableMap(tmpMap);                            
        }
@@ -39,7 +39,7 @@ public class CodecJigDFS implements SplitterCodec {
                return CodecJigDFS.codecDescription;
        }
 
-       private int k,m,packetsize;
+       private int k,m,chunkSize;
        private InformationDispersalCodec crsidacodec;
        private InformationDispersalEncoder encoder;
        private InformationDispersalDecoder decoder;
@@ -55,7 +55,7 @@ public class CodecJigDFS implements SplitterCodec {
                codecParameter.put("k", k);
                codecParameter.put("m", m);
 //             codecParameter.put("packetsize", 4096);
-               codecParameter.put("packetsize", 64);
+               codecParameter.put("chunksize", 64);
                init(codecParameter);
        }
        
@@ -87,10 +87,10 @@ public class CodecJigDFS implements SplitterCodec {
                        }
                        k = (int) codecParameter.get("k");
                        m = (int) codecParameter.get("m");
-                       packetsize = (int) codecParameter.get("packetsize");
+                       chunkSize = (int) codecParameter.get("chunksize");
                        
                        try {
-                               crsidacodec = new CauchyInformationDispersalCodec(k+m, m, packetsize);
+                               crsidacodec = new CauchyInformationDispersalCodec(k+m, m, chunkSize);
                                encoder = crsidacodec.getEncoder();
                                decoder = crsidacodec.getDecoder();
                        } catch (IDAInvalidParametersException e) {
index 3a3b459..9c5b8b2 100644 (file)
@@ -16,7 +16,7 @@ import splitterng.plugin.interfaces.Plugable;
 import splitterng.plugin.interfaces.SplitterCodec;
 
 public class SplitterPluginJigDFS implements Plugable {
-       private final String pluginID = "JigDFSPlugin";
+       private final String pluginID = "JigDFS";
        private final String pluginName = "Plugin JigDFS";
        private final String pluginDescriptionText = "Diese Plugin stellt die JigDFS Bibliothek als Codec zur Verfügung";
        private final Collection<String> dependencies = Arrays.asList("");
index 05e566a..8d873e4 100644 (file)
@@ -66,10 +66,10 @@ public class SplitterTest implements SplitterCallback {
                                case "jerasure/JerasureCauchyGood":
                                        // Codecparameter Bauen
                                        Map<String, Integer> codecParameter = new TreeMap<String, Integer>();
-                                       codecParameter.put("k", 3);
-                                       codecParameter.put("m", 3);
-                                       codecParameter.put("w", 16);
-                                       codecParameter.put("packetsize", 64);
+                                       codecParameter.put("k", 2);
+                                       codecParameter.put("m", 2);
+                                       codecParameter.put("w", 8);
+                                       codecParameter.put("packetsize", 8);
                                        System.out.println("\t\tinitialisiere mit" + " k="
                                                        + codecParameter.get("k") + " m="
                                                        + codecParameter.get("m") + " w="
@@ -83,7 +83,7 @@ public class SplitterTest implements SplitterCallback {
                                        
                                        // Metadaten bauen vorlage
                                        Map<String, Object> metadatajerasure = new TreeMap<String, Object>();
-                                       metadatajerasure.put("fragmentsize", (int) 4096);
+                                       metadatajerasure.put("fragmentsize", (int) 64);
                                        // Beleiebige weitere Metadaten
                                        
                                        splitter_metadata_map.put(splitterjerasure, metadatajerasure);
@@ -168,8 +168,8 @@ public class SplitterTest implements SplitterCallback {
                                case "jsharing/shamir":
                                        // Codecparameter Bauen
                                        Map<String, Integer> codecParameterjsharing = new TreeMap<String, Integer>();
-                                       codecParameterjsharing.put("k", 3);
-                                       codecParameterjsharing.put("m", 3);
+                                       codecParameterjsharing.put("k", 2);
+                                       codecParameterjsharing.put("m", 1);
                                        System.out.println("\t\tinitialisiere mit k="
                                                        + codecParameterjsharing.get("k") + " m="
                                                        + codecParameterjsharing.get("m"));
@@ -180,7 +180,7 @@ public class SplitterTest implements SplitterCallback {
                                        
                                        // Metadaten bauen vorlage
                                        Map<String, Object> metadatashamir = new TreeMap<String, Object>();
-                                       metadatashamir.put("fragmentsize", (int)2);
+                                       metadatashamir.put("fragmentsize", (int)8);
                                        // Beleiebige weitere Metadaten
                                        
                                        splitter_metadata_map.put(splittershamir, metadatashamir);
@@ -190,10 +190,10 @@ public class SplitterTest implements SplitterCallback {
                                case "jerasure-java/JerasureJavaCRS":
                                        // Codecparameter Bauen
                                        Map<String, Integer> codecParameter11 = new TreeMap<String, Integer>();
-                                       codecParameter11.put("k", 3);
-                                       codecParameter11.put("m", 3);
+                                       codecParameter11.put("k", 2);
+                                       codecParameter11.put("m", 2);
                                        codecParameter11.put("w", 8);
-                                       codecParameter11.put("packetsize", 32);
+                                       codecParameter11.put("packetsize", 8);
                                        System.out.println("\t\tinitialisiere mit" + " k="
                                                        + codecParameter11.get("k") + " m="
                                                        + codecParameter11.get("m") + " w="
@@ -207,23 +207,23 @@ public class SplitterTest implements SplitterCallback {
                                        
                                        // Metadaten bauen vorlage
                                        Map<String, Object> metadatajerasure11 = new TreeMap<String, Object>();
-                                       metadatajerasure11.put("fragmentsize", (int) 256);
+                                       metadatajerasure11.put("fragmentsize", (int) 64);
                                        // Beleiebige weitere Metadaten
                                        
                                        splitter_metadata_map.put(splitterjerasure11, metadatajerasure11);
                                        break;
 ///-----------------------------------------------------------------------------------------------
                                        
-                               case "JigDFSPlugin/JigDFScodec":
+                               case "JigDFS/crs":
                                        // Codecparameter Bauen
                                        Map<String, Integer> codecParameter111 = new TreeMap<String, Integer>();
-                                       codecParameter111.put("k", 3);
-                                       codecParameter111.put("m", 2);
-                                       codecParameter111.put("packetsize", 1024);
+                                       codecParameter111.put("k", 2);
+                                       codecParameter111.put("m", 1);
+                                       codecParameter111.put("chunksize", 16);
                                        System.out.println("\t\tinitialisiere mit" + " k="
                                                        + codecParameter111.get("k") + " m="
-                                                       + codecParameter111.get("m") + " packetsize="
-                                                       + codecParameter111.get("packetsize"));
+                                                       + codecParameter111.get("m") + " chunksize="
+                                                       + codecParameter111.get("chunksize"));
                                        // Splitter mit Plugin-ID CodecID und codecparametern
                                        // initialisieren
                                        Splitter splitterjerasure111 = new Splitter(p.getPluginID(), c.getCodecID(),
@@ -232,7 +232,7 @@ public class SplitterTest implements SplitterCallback {
                                        
                                        // Metadaten bauen vorlage
                                        Map<String, Object> metadatajerasure111 = new TreeMap<String, Object>();
-                                       metadatajerasure111.put("fragmentsize", (int) 1024);
+                                       metadatajerasure111.put("fragmentsize", (int) 64);
                                        metadatajerasure111.put("digest", "SHA-256");
                                        //metadatajerasure111.put("digest", "MD5");
                                        // Beleiebige weitere Metadaten
@@ -243,8 +243,8 @@ public class SplitterTest implements SplitterCallback {
                                case "bitsplitter/bitsplitter":
                                        // Codecparameter Bauen
                                        Map<String, Integer> codecParameter1111 = new TreeMap<String, Integer>();
-                                       codecParameter1111.put("k", 2);
-                                       codecParameter1111.put("m", 0);
+                                       codecParameter1111.put("k", 3);
+                                       codecParameter1111.put("m", 1);
                                        System.out.println("\t\tinitialisiere mit" + " k="
                                                        + codecParameter1111.get("k") + " m="
                                                        + codecParameter1111.get("m") + " w=" );
@@ -256,7 +256,7 @@ public class SplitterTest implements SplitterCallback {
                                        
                                        // Metadaten bauen vorlage
                                        Map<String, Object> metadata1111 = new TreeMap<String, Object>();
-                                       metadata1111.put("fragmentsize", (int) 256);
+                                       metadata1111.put("fragmentsize", (int) 43);
                                        // Beleiebige weitere Metadaten
                                        
                                        splitter_metadata_map.put(splitter1111, metadata1111);