package com.neverwinterdp.storage.hdfs;

import org.junit.Test;

public class HDFSStorageTaggingUnitTest extends HDFSStorageTest {
  @Test
  public void testHDFSStorage() throws Exception {
    int NUM_OF_STREAMS = 5;
    HDFSStorageConfig storageConfig = new HDFSStorageConfig("test", HDFS_DIR);
    storageConfig.setReplication(2);
    storageConfig.setPartitionStream(NUM_OF_STREAMS);
    HDFSStorage storage = new HDFSStorage(registry,fs, storageConfig);
    storage.create();
    
    write(storage, 1000 /*1000 message per stream*/);
    storage.doManagement();
    HDFSStorageTag tag100 = storage.getRegistry().createTagByPosition("tag-100", "Tag at pos 100", 100);
    
    int totalCount = count(storage, tag100); //count from tag100
    System.err.println("Total Count = " + totalCount);
  }
}

@@ -34,16 +34,40 @@
 .hdfs;%0A%0A
+import java.util.Date;%0A%0A
 import o
@@ -81,16 +81,16 @@
 t.Test;%0A
-
 %0Apublic 
@@ -174,27 +174,33 @@
 oid test
-HDFSStorage
+TaggingByPosition
 () throw
@@ -697,24 +697,24 @@
  100);%0A    %0A
-
     int tota
@@ -825,10 +825,880 @@
 t);%0A  %7D%0A
+  %0A  @Test%0A  public void testTaggingByDate() throws Exception %7B%0A    int NUM_OF_STREAMS = 5;%0A    HDFSStorageConfig storageConfig = new HDFSStorageConfig(%22test%22, HDFS_DIR);%0A    storageConfig.setReplication(2);%0A    storageConfig.setPartitionStream(NUM_OF_STREAMS);%0A    HDFSStorage storage = new HDFSStorage(registry,fs, storageConfig);%0A    storage.create();%0A    %0A    write(storage, 1000 /*1000 message per stream*/);%0A    storage.doManagement();%0A    %0A    write(storage, 1000 /*1000 message per stream*/);%0A    storage.doManagement();%0A    %0A    HDFSStorageTag time1Tag = storage.getRegistry().createTagByDateTime(%22time1%22, %22Tag by the current time1%22, new Date());%0A%0A    write(storage, 1000 /*1000 message per stream*/);%0A    storage.doManagement();%0A    %0A    int totalCount = count(storage, time1Tag); //count from tag100%0A    System.err.println(%22Total Count = %22 + totalCount);%0A  %7D%0A
 %7D%0A

enhance the hdfs tag implementation and test