geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [1/3] incubator-geode git commit: Moving the RegionDirectory classes to their own package
Date Thu, 27 Aug 2015 01:07:47 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-11 0c0f620b0 -> 07528954e


Moving the RegionDirectory classes to their own package


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/d802082c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/d802082c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/d802082c

Branch: refs/heads/feature/GEODE-11
Commit: d802082cf62cb10f97382a0bc7d176aeaad865ca
Parents: 0c0f620
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Wed Aug 26 13:49:37 2015 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Aug 26 13:49:37 2015 -0700

----------------------------------------------------------------------
 .../cache/lucene/internal/FileIndexInput.java   | 112 ------------
 .../cache/lucene/internal/RegionDirectory.java  | 179 -------------------
 .../internal/directory/FileIndexInput.java      | 112 ++++++++++++
 .../internal/directory/RegionDirectory.java     | 179 +++++++++++++++++++
 .../internal/RegionDirectoryJUnitTest.java      |  37 ----
 .../directory/RegionDirectoryJUnitTest.java     |  37 ++++
 6 files changed, 328 insertions(+), 328 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d802082c/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/FileIndexInput.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/FileIndexInput.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/FileIndexInput.java
deleted file mode 100644
index 9ad20ec..0000000
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/FileIndexInput.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.gemstone.gemfire.cache.lucene.internal;
-
-import java.io.EOFException;
-import java.io.IOException;
-
-import org.apache.lucene.store.IndexInput;
-
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.SeekableInputStream;
-
-final class FileIndexInput extends IndexInput {
-  private final File file;
-  SeekableInputStream in;
-  private long position;
-  
-  //Used for slice operations
-  private long sliceOffset;
-  private long sliceLength;
-  
-  FileIndexInput(String resourceDesc, File file) {
-    this(resourceDesc, file, 0L, file.getLength());
-  }
-
-  /**
-   * Constructor for a slice.
-   */
-  private FileIndexInput(String resourceDesc, File file, long offset, long length) {
-    super(resourceDesc);
-    this.file = file;
-    in = file.getInputStream();
-    this.sliceOffset = offset;
-    this.sliceLength = length;
-  }
-
-  @Override
-  public long length() {
-    return sliceLength;
-  }
-
-  @Override
-  public void close() throws IOException {
-    in.close();
-  }
-  
-  @Override
-  public FileIndexInput clone() {
-    FileIndexInput clone = (FileIndexInput)super.clone();
-    clone.in = in.clone();
-    return clone;
-  }
-
-  @Override
-  public long getFilePointer() {
-    return position;
-  }
-
-  @Override
-  public void seek(long pos) throws IOException {
-    in.seek(pos + sliceOffset);
-    this.position = pos;
-  }
-
-  @Override
-  public IndexInput slice(String sliceDescription, long offset, long length)
-      throws IOException {
-    if(length > (this.sliceLength - offset)) {
-      throw new IllegalArgumentException("Slice length is to large. Asked for " + length
+ " file length is " + sliceLength + ": " + this.file.getName());
-    }
-    if(offset < 0 || offset >= this.sliceLength) {
-      throw new IllegalArgumentException("Slice offset is invalid: " + this.file.getName());
-    }
-    
-    FileIndexInput result = new FileIndexInput(sliceDescription, file, sliceOffset + offset,
length);
-    result.seek(0);
-    return result;
-  }
-
-  @Override
-  public byte readByte() throws IOException {
-    if(++position > sliceLength) {
-      throw new EOFException("Read past end of file " + file.getName());
-    }
-    
-    int result = in.read();
-    if(result == -1) {
-      throw new EOFException("Read past end of file " + file.getName());
-    } else {
-      return (byte) result;
-    }
-  }
-
-  @Override
-  public void readBytes(byte[] b, int offset, int len) throws IOException {
-    if(len == 0) {
-      return;
-    }
-    
-    if(position + len > sliceLength) {
-      throw new EOFException("Read past end of file " + file.getName());
-    }
-    
-    //For the FileSystemInputStream, it will always read all bytes, up
-    //until the end of the file. So if we didn't get enough bytes, it's
-    //because we reached the end of the file.
-    int numRead = in.read(b, offset, len);
-    if(numRead < len) {
-      throw new EOFException("Read past end of file " + file.getName());
-    }
-    
-    position+=len;
-  } 
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d802082c/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectory.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectory.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectory.java
deleted file mode 100644
index 2e2dd14..0000000
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectory.java
+++ /dev/null
@@ -1,179 +0,0 @@
-package com.gemstone.gemfire.cache.lucene.internal;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Collection;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.logging.log4j.Logger;
-import org.apache.lucene.store.BaseDirectory;
-import org.apache.lucene.store.BufferedIndexInput;
-import org.apache.lucene.store.IOContext;
-import org.apache.lucene.store.IndexInput;
-import org.apache.lucene.store.IndexOutput;
-import org.apache.lucene.store.OutputStreamIndexOutput;
-import org.apache.lucene.store.SingleInstanceLockFactory;
-
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.PartitionAttributesFactory;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.ChunkKey;
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.FileSystem;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.internal.logging.LogService;
-
-/**
- * An implementation of Directory that stores data in geode regions.
- * 
- * Directory is an interface to file/RAM storage for lucene. This class uses
- * the {@link FileSystem} class to store the data in the provided geode
- * regions.
- */
-public class RegionDirectory extends BaseDirectory {
-
-  static private final boolean CREATE_CACHE = Boolean.getBoolean("lucene.createCache");
-  private static final Logger logger = LogService.getLogger();
-  
-  private final FileSystem fs;
-  
-  /**
-   * Create RegionDirectory to save index documents in file format into Gemfire region.
-   * @param dataRegionName data region's full name to build index from
-   */
-  public RegionDirectory(String dataRegionName) {
-    super(new SingleInstanceLockFactory());
-
-    Cache cache = null;
-    try {
-       cache = CacheFactory.getAnyInstance();
-    } catch (Exception e) {
-      //ignore
-    }
-    if (null == cache) {
-      if (CREATE_CACHE) {
-        cache = new CacheFactory().set("mcast-port", "0").set("log-level", "error").create();
-        logger.info("Created cache in RegionDirectory");
-      } else {
-        throw new IllegalStateException(LocalizedStrings.CqService_CACHE_IS_NULL.toLocalizedString());
-      }
-    } else {
-      logger.info("Found cache in RegionDirectory");
-    }
-    
-    Region dataRegion = cache.getRegion(dataRegionName);
-    assert dataRegion != null;
-    RegionAttributes ra = dataRegion.getAttributes();
-    DataPolicy dp = ra.getDataPolicy();
-    final boolean isPartitionedRegion = (ra.getPartitionAttributes() == null) ? false : true;
-    final boolean withPersistence = dp.withPersistence();
-    final boolean withStorage = isPartitionedRegion?ra.getPartitionAttributes().getLocalMaxMemory()>0:dp.withStorage();
-    RegionShortcut regionShortCut;
-    if (isPartitionedRegion) {
-      if (withPersistence) {
-        regionShortCut = RegionShortcut.PARTITION_PERSISTENT;
-      } else {
-        regionShortCut = RegionShortcut.PARTITION;
-      }
-    } else {
-      if (withPersistence) {
-        regionShortCut = RegionShortcut.REPLICATE_PERSISTENT;
-      } else {
-        regionShortCut = RegionShortcut.REPLICATE;
-      }
-    }
-    
-//    final boolean isOffHeap = ra.getOffHeap();
-    // TODO: 1) dataRegion should be withStorage
-    //       2) Persistence to Persistence
-    //       3) Replicate to Replicate, Partition To Partition
-    //       4) Offheap to Offheap
-    if (!withStorage) {
-      throw new IllegalStateException("The data region to create lucene index should be with
storage");
-    }
-    
-    final String fileRegionName = dataRegionName+".files";
-    Region<String, File> fileRegion = cache.<String, File> getRegion(fileRegionName);
-    if (null == fileRegion) {
-      fileRegion = cache.<String, File> createRegionFactory(regionShortCut)
-          .setPartitionAttributes(new PartitionAttributesFactory<String, File>().setColocatedWith(dataRegionName).create())
-          .create(fileRegionName);
-    }
-
-    final String chunkRegionName = dataRegionName + ".chunks";
-    Region<ChunkKey, byte[]> chunkRegion = cache.<ChunkKey, byte[]> getRegion(chunkRegionName);
-    if (null == chunkRegion) {
-      chunkRegion = cache.<ChunkKey, byte[]> createRegionFactory(regionShortCut)
-          .setPartitionAttributes(new PartitionAttributesFactory<ChunkKey, byte[]>().setColocatedWith(fileRegion.getFullPath()).create())
-          .create(chunkRegionName);
-    }
-    
-    fs = new FileSystem(fileRegion, chunkRegion);
-  }
-  
-  /**
-   * Create a region directory with a given file and chunk region. These regions
-   * may be bucket regions or they may be replicated regions.
-   */
-  public RegionDirectory(ConcurrentMap<String, File> fileRegion, ConcurrentMap<ChunkKey,
byte[]> chunkRegion) {
-    super(new SingleInstanceLockFactory());
-    fs = new FileSystem(fileRegion, chunkRegion);
-  }
-  
-  @Override
-  public String[] listAll() throws IOException {
-    ensureOpen();
-    return fs.listFileNames().toArray(new String[] {});
-  }
-
-  @Override
-  public void deleteFile(String name) throws IOException {
-    ensureOpen();
-    fs.deleteFile(name);
-  }
-
-  @Override
-  public long fileLength(String name) throws IOException {
-    ensureOpen();
-    return fs.getFile(name).getLength();
-  }
-
-  @Override
-  public IndexOutput createOutput(final String name, final IOContext context) throws IOException
{
-    ensureOpen();
-    final File file = fs.createFile(name);
-    final OutputStream out = file.getOutputStream();
-
-    return new OutputStreamIndexOutput(name, out, 1000);
-  }
-
-  @Override
-  public void sync(Collection<String> names) throws IOException {
-    ensureOpen();
-    // Region does not need to sync to disk
-  }
-
-  @Override
-  public void renameFile(String source, String dest) throws IOException {
-    ensureOpen();
-    fs.renameFile(source, dest);
-  }
-
-  @Override
-  public IndexInput openInput(String name, IOContext context) throws IOException {
-    ensureOpen();
-    final File file = fs.getFile(name);
-
-    return new FileIndexInput(name, file);
-  }
-
-  @Override
-  public void close() throws IOException {
-    isOpen = false;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d802082c/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/FileIndexInput.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/FileIndexInput.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/FileIndexInput.java
new file mode 100644
index 0000000..235cd3a
--- /dev/null
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/FileIndexInput.java
@@ -0,0 +1,112 @@
+package com.gemstone.gemfire.cache.lucene.internal.directory;
+
+import java.io.EOFException;
+import java.io.IOException;
+
+import org.apache.lucene.store.IndexInput;
+
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.SeekableInputStream;
+
+final class FileIndexInput extends IndexInput {
+  private final File file;
+  SeekableInputStream in;
+  private long position;
+  
+  //Used for slice operations
+  private long sliceOffset;
+  private long sliceLength;
+  
+  FileIndexInput(String resourceDesc, File file) {
+    this(resourceDesc, file, 0L, file.getLength());
+  }
+
+  /**
+   * Constructor for a slice.
+   */
+  private FileIndexInput(String resourceDesc, File file, long offset, long length) {
+    super(resourceDesc);
+    this.file = file;
+    in = file.getInputStream();
+    this.sliceOffset = offset;
+    this.sliceLength = length;
+  }
+
+  @Override
+  public long length() {
+    return sliceLength;
+  }
+
+  @Override
+  public void close() throws IOException {
+    in.close();
+  }
+  
+  @Override
+  public FileIndexInput clone() {
+    FileIndexInput clone = (FileIndexInput)super.clone();
+    clone.in = in.clone();
+    return clone;
+  }
+
+  @Override
+  public long getFilePointer() {
+    return position;
+  }
+
+  @Override
+  public void seek(long pos) throws IOException {
+    in.seek(pos + sliceOffset);
+    this.position = pos;
+  }
+
+  @Override
+  public IndexInput slice(String sliceDescription, long offset, long length)
+      throws IOException {
+    if(length > (this.sliceLength - offset)) {
+      throw new IllegalArgumentException("Slice length is to large. Asked for " + length
+ " file length is " + sliceLength + ": " + this.file.getName());
+    }
+    if(offset < 0 || offset >= this.sliceLength) {
+      throw new IllegalArgumentException("Slice offset is invalid: " + this.file.getName());
+    }
+    
+    FileIndexInput result = new FileIndexInput(sliceDescription, file, sliceOffset + offset,
length);
+    result.seek(0);
+    return result;
+  }
+
+  @Override
+  public byte readByte() throws IOException {
+    if(++position > sliceLength) {
+      throw new EOFException("Read past end of file " + file.getName());
+    }
+    
+    int result = in.read();
+    if(result == -1) {
+      throw new EOFException("Read past end of file " + file.getName());
+    } else {
+      return (byte) result;
+    }
+  }
+
+  @Override
+  public void readBytes(byte[] b, int offset, int len) throws IOException {
+    if(len == 0) {
+      return;
+    }
+    
+    if(position + len > sliceLength) {
+      throw new EOFException("Read past end of file " + file.getName());
+    }
+    
+    //For the FileSystemInputStream, it will always read all bytes, up
+    //until the end of the file. So if we didn't get enough bytes, it's
+    //because we reached the end of the file.
+    int numRead = in.read(b, offset, len);
+    if(numRead < len) {
+      throw new EOFException("Read past end of file " + file.getName());
+    }
+    
+    position+=len;
+  } 
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d802082c/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectory.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectory.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectory.java
new file mode 100644
index 0000000..861c07d
--- /dev/null
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectory.java
@@ -0,0 +1,179 @@
+package com.gemstone.gemfire.cache.lucene.internal.directory;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.concurrent.ConcurrentMap;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.lucene.store.BaseDirectory;
+import org.apache.lucene.store.BufferedIndexInput;
+import org.apache.lucene.store.IOContext;
+import org.apache.lucene.store.IndexInput;
+import org.apache.lucene.store.IndexOutput;
+import org.apache.lucene.store.OutputStreamIndexOutput;
+import org.apache.lucene.store.SingleInstanceLockFactory;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.ChunkKey;
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.FileSystem;
+import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.internal.logging.LogService;
+
+/**
+ * An implementation of Directory that stores data in geode regions.
+ * 
+ * Directory is an interface to file/RAM storage for lucene. This class uses
+ * the {@link FileSystem} class to store the data in the provided geode
+ * regions.
+ */
+public class RegionDirectory extends BaseDirectory {
+
+  static private final boolean CREATE_CACHE = Boolean.getBoolean("lucene.createCache");
+  private static final Logger logger = LogService.getLogger();
+  
+  private final FileSystem fs;
+  
+  /**
+   * Create RegionDirectory to save index documents in file format into Gemfire region.
+   * @param dataRegionName data region's full name to build index from
+   */
+  public RegionDirectory(String dataRegionName) {
+    super(new SingleInstanceLockFactory());
+
+    Cache cache = null;
+    try {
+       cache = CacheFactory.getAnyInstance();
+    } catch (Exception e) {
+      //ignore
+    }
+    if (null == cache) {
+      if (CREATE_CACHE) {
+        cache = new CacheFactory().set("mcast-port", "0").set("log-level", "error").create();
+        logger.info("Created cache in RegionDirectory");
+      } else {
+        throw new IllegalStateException(LocalizedStrings.CqService_CACHE_IS_NULL.toLocalizedString());
+      }
+    } else {
+      logger.info("Found cache in RegionDirectory");
+    }
+    
+    Region dataRegion = cache.getRegion(dataRegionName);
+    assert dataRegion != null;
+    RegionAttributes ra = dataRegion.getAttributes();
+    DataPolicy dp = ra.getDataPolicy();
+    final boolean isPartitionedRegion = (ra.getPartitionAttributes() == null) ? false : true;
+    final boolean withPersistence = dp.withPersistence();
+    final boolean withStorage = isPartitionedRegion?ra.getPartitionAttributes().getLocalMaxMemory()>0:dp.withStorage();
+    RegionShortcut regionShortCut;
+    if (isPartitionedRegion) {
+      if (withPersistence) {
+        regionShortCut = RegionShortcut.PARTITION_PERSISTENT;
+      } else {
+        regionShortCut = RegionShortcut.PARTITION;
+      }
+    } else {
+      if (withPersistence) {
+        regionShortCut = RegionShortcut.REPLICATE_PERSISTENT;
+      } else {
+        regionShortCut = RegionShortcut.REPLICATE;
+      }
+    }
+    
+//    final boolean isOffHeap = ra.getOffHeap();
+    // TODO: 1) dataRegion should be withStorage
+    //       2) Persistence to Persistence
+    //       3) Replicate to Replicate, Partition To Partition
+    //       4) Offheap to Offheap
+    if (!withStorage) {
+      throw new IllegalStateException("The data region to create lucene index should be with
storage");
+    }
+    
+    final String fileRegionName = dataRegionName+".files";
+    Region<String, File> fileRegion = cache.<String, File> getRegion(fileRegionName);
+    if (null == fileRegion) {
+      fileRegion = cache.<String, File> createRegionFactory(regionShortCut)
+          .setPartitionAttributes(new PartitionAttributesFactory<String, File>().setColocatedWith(dataRegionName).create())
+          .create(fileRegionName);
+    }
+
+    final String chunkRegionName = dataRegionName + ".chunks";
+    Region<ChunkKey, byte[]> chunkRegion = cache.<ChunkKey, byte[]> getRegion(chunkRegionName);
+    if (null == chunkRegion) {
+      chunkRegion = cache.<ChunkKey, byte[]> createRegionFactory(regionShortCut)
+          .setPartitionAttributes(new PartitionAttributesFactory<ChunkKey, byte[]>().setColocatedWith(fileRegion.getFullPath()).create())
+          .create(chunkRegionName);
+    }
+    
+    fs = new FileSystem(fileRegion, chunkRegion);
+  }
+  
+  /**
+   * Create a region directory with a given file and chunk region. These regions
+   * may be bucket regions or they may be replicated regions.
+   */
+  public RegionDirectory(ConcurrentMap<String, File> fileRegion, ConcurrentMap<ChunkKey,
byte[]> chunkRegion) {
+    super(new SingleInstanceLockFactory());
+    fs = new FileSystem(fileRegion, chunkRegion);
+  }
+  
+  @Override
+  public String[] listAll() throws IOException {
+    ensureOpen();
+    return fs.listFileNames().toArray(new String[] {});
+  }
+
+  @Override
+  public void deleteFile(String name) throws IOException {
+    ensureOpen();
+    fs.deleteFile(name);
+  }
+
+  @Override
+  public long fileLength(String name) throws IOException {
+    ensureOpen();
+    return fs.getFile(name).getLength();
+  }
+
+  @Override
+  public IndexOutput createOutput(final String name, final IOContext context) throws IOException
{
+    ensureOpen();
+    final File file = fs.createFile(name);
+    final OutputStream out = file.getOutputStream();
+
+    return new OutputStreamIndexOutput(name, out, 1000);
+  }
+
+  @Override
+  public void sync(Collection<String> names) throws IOException {
+    ensureOpen();
+    // Region does not need to sync to disk
+  }
+
+  @Override
+  public void renameFile(String source, String dest) throws IOException {
+    ensureOpen();
+    fs.renameFile(source, dest);
+  }
+
+  @Override
+  public IndexInput openInput(String name, IOContext context) throws IOException {
+    ensureOpen();
+    final File file = fs.getFile(name);
+
+    return new FileIndexInput(name, file);
+  }
+
+  @Override
+  public void close() throws IOException {
+    isOpen = false;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d802082c/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectoryJUnitTest.java
b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectoryJUnitTest.java
deleted file mode 100644
index 3ff825e..0000000
--- a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/RegionDirectoryJUnitTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.gemstone.gemfire.cache.lucene.internal;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.lucene.store.BaseDirectoryTestCase;
-import org.apache.lucene.store.Directory;
-import org.junit.After;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.ChunkKey;
-import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-/**
- * A unit test of the RegionDirectory class that uses the Directory test
- * case from the lucene code base.
- * 
- * This test is still mocking out the underlying cache, rather than using
- * a real region.
- */
-@Category(UnitTest.class)
-public class RegionDirectoryJUnitTest extends BaseDirectoryTestCase {
-  
-  @After
-  public void clearLog4J() {
-    //The lucene test ensures that no system properties
-    //have been modified by the test. GFE leaves this property
-    //set
-    System.clearProperty("log4j.configurationFile");
-  }
-  
-  protected Directory getDirectory(Path path) throws IOException {
-    return new RegionDirectory(new ConcurrentHashMap<String, File>(), new ConcurrentHashMap<ChunkKey,
byte[]>());
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d802082c/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
new file mode 100644
index 0000000..3c14c31
--- /dev/null
+++ b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/directory/RegionDirectoryJUnitTest.java
@@ -0,0 +1,37 @@
+package com.gemstone.gemfire.cache.lucene.internal.directory;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.lucene.store.BaseDirectoryTestCase;
+import org.apache.lucene.store.Directory;
+import org.junit.After;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.ChunkKey;
+import com.gemstone.gemfire.cache.lucene.internal.filesystem.File;
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+/**
+ * A unit test of the RegionDirectory class that uses the Directory test
+ * case from the lucene code base.
+ * 
+ * This test is still mocking out the underlying cache, rather than using
+ * a real region.
+ */
+@Category(UnitTest.class)
+public class RegionDirectoryJUnitTest extends BaseDirectoryTestCase {
+  
+  @After
+  public void clearLog4J() {
+    //The lucene test ensures that no system properties
+    //have been modified by the test. GFE leaves this property
+    //set
+    System.clearProperty("log4j.configurationFile");
+  }
+  
+  protected Directory getDirectory(Path path) throws IOException {
+    return new RegionDirectory(new ConcurrentHashMap<String, File>(), new ConcurrentHashMap<ChunkKey,
byte[]>());
+  }
+}


Mime
View raw message