incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/3] git commit: Adding an interface for directories that will be wrapped by the BlockDirectory. This is because the BlockDirectory needs to know the last modified time of the given file.
Date Wed, 22 May 2013 00:58:16 GMT
Updated Branches:
  refs/heads/0.1.5 a51089570 -> db3d6b181


Adding an interface for directories that will be wrapped by the BlockDirectory.  This is because
the BlockDirectory needs to know the last modified time of the given file.


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

Branch: refs/heads/0.1.5
Commit: f5949e51b476aec6e779aeeefa46c069d3c9e4ed
Parents: a510895
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue May 21 20:45:56 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue May 21 20:45:56 2013 -0400

----------------------------------------------------------------------
 .../blur/store/blockcache/BlockDirectory.java      |    2 +
 .../apache/blur/store/blockcache/LastModified.java |   30 +++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f5949e51/src/blur-store/src/main/java/org/apache/blur/store/blockcache/BlockDirectory.java
----------------------------------------------------------------------
diff --git a/src/blur-store/src/main/java/org/apache/blur/store/blockcache/BlockDirectory.java
b/src/blur-store/src/main/java/org/apache/blur/store/blockcache/BlockDirectory.java
index 87b35c1..041b10d 100644
--- a/src/blur-store/src/main/java/org/apache/blur/store/blockcache/BlockDirectory.java
+++ b/src/blur-store/src/main/java/org/apache/blur/store/blockcache/BlockDirectory.java
@@ -236,6 +236,8 @@ public class BlockDirectory extends Directory implements DirectoryDecorator
{
       return file.lastModified();
     } else if (_directory instanceof HdfsDirectory) {
       return ((HdfsDirectory) _directory).getFileModified(name);
+    } else if (_directory instanceof LastModified) {
+      return ((LastModified) _directory).getFileModified(name);
     } else {
       throw new RuntimeException("Not supported");
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f5949e51/src/blur-store/src/main/java/org/apache/blur/store/blockcache/LastModified.java
----------------------------------------------------------------------
diff --git a/src/blur-store/src/main/java/org/apache/blur/store/blockcache/LastModified.java
b/src/blur-store/src/main/java/org/apache/blur/store/blockcache/LastModified.java
new file mode 100644
index 0000000..e64037d
--- /dev/null
+++ b/src/blur-store/src/main/java/org/apache/blur/store/blockcache/LastModified.java
@@ -0,0 +1,30 @@
+package org.apache.blur.store.blockcache;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import java.io.IOException;
+
+/**
+ * The block cache needs to know when the file was last modified for unique file
+ * naming. So when an index is removed and replaced the file cache is not
+ * mistakenly used.
+ */
+public interface LastModified {
+
+  long getFileModified(String name) throws IOException;
+
+}


Mime
View raw message