asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Maxon (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Remove vestiges of Virtual pages
Date Wed, 04 Jan 2017 13:04:07 GMT
Ian Maxon has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1413

Change subject: Remove vestiges of Virtual pages
......................................................................

Remove vestiges of Virtual pages

This concept was altered into confiscated pages, but some of the old
vestiges stuck around. This is just to remove them as the code is
not used and the terminology is very easy to conflate with the
terms used in the LSM wrapper.

Change-Id: I9ce8ea25a021d069e02eb15fcb80d703c06a883c
---
M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/FileMapManager.java
M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/MultitenantVirtualBufferCache.java
M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/VirtualBufferCache.java
M hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
M hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/DebugBufferCache.java
M hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/IBufferCache.java
M hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/IFileMapManager.java
M hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/TransientFileMapManager.java
8 files changed, 1 insertion(+), 118 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/13/1413/1

diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/FileMapManager.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/FileMapManager.java
index c492661..c4a294d 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/FileMapManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/FileMapManager.java
@@ -82,15 +82,4 @@
         name2IdMap.put(fileName, fileId);
     }
 
-    @Override
-    public int registerMemoryFile() {
-        Integer fileId = idCounter++;
-        id2nameMap.put(fileId, null);
-        return fileId;
-    }
-
-    @Override
-    public void unregisterMemFile(int fileId) throws HyracksDataException {
-        id2nameMap.remove(fileId);
-    }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/MultitenantVirtualBufferCache.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/MultitenantVirtualBufferCache.java
index 3ef419e..6878fcf 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/MultitenantVirtualBufferCache.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/MultitenantVirtualBufferCache.java
@@ -131,17 +131,6 @@
         return vbc.getFileMapProvider();
     }
 
-    //These 4 methods are not applicable here
-    @Override
-    public int createMemFile() throws HyracksDataException {
-        throw new UnsupportedOperationException("Virtual Pages are not a valid concept in
this context");
-    }
-
-    @Override
-    public void deleteMemFile(int fileId) throws HyracksDataException {
-        throw new UnsupportedOperationException("Virtual Pages are not a valid concept in
this context");
-    }
-
     @Override
     public int getNumPagesOfFile(int fileId) throws HyracksDataException {
         throw new UnsupportedOperationException();
@@ -179,11 +168,6 @@
     @Override
     public void finishQueue() {
         throw new UnsupportedOperationException("Virtual buffer caches don't have FIFO writers");
-    }
-
-    @Override
-    public void copyPage(ICachedPage src, ICachedPage dst) {
-
     }
 
     @Override
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/VirtualBufferCache.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/VirtualBufferCache.java
index 416f859..2568435 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/VirtualBufferCache.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/VirtualBufferCache.java
@@ -422,16 +422,6 @@
         }
     }
 
-    //These 4 methods aren't applicable here.
-    @Override
-    public int createMemFile() throws HyracksDataException {
-        return 0;
-    }
-
-    @Override
-    public void deleteMemFile(int fileId) throws HyracksDataException {
-    }
-
     @Override
     public int getNumPagesOfFile(int fileId) throws HyracksDataException {
         synchronized (fileMapManager) {
@@ -473,11 +463,6 @@
     @Override
     public ICachedPage confiscateLargePage(long dpid, int multiplier, int extraBlockPageId)
             throws HyracksDataException {
-        throw new UnsupportedOperationException("Virtual buffer caches don't have FIFO writers");
-    }
-
-    @Override
-    public void copyPage(ICachedPage src, ICachedPage dst) {
         throw new UnsupportedOperationException("Virtual buffer caches don't have FIFO writers");
     }
 
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
index e201181..7004bd8 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/BufferCache.java
@@ -70,7 +70,6 @@
     private final IFileMapManager fileMapManager;
     private final CleanerThread cleanerThread;
     private final Map<Integer, BufferedFileHandle> fileInfoMap;
-    private final Set<Integer> virtualFiles;
     private final AsyncFIFOPageQueueManager fifoWriter;
     private final Queue<BufferCacheHeaderHelper> headerPageCache = new ConcurrentLinkedQueue<>();
 
@@ -104,7 +103,6 @@
 
         Executor executor = Executors.newCachedThreadPool(threadFactory);
         fileInfoMap = new HashMap<>();
-        virtualFiles = new HashSet<>();
         cleanerThread = new CleanerThread();
         executor.execute(cleanerThread);
         closed = false;
@@ -153,7 +151,7 @@
         synchronized (fileInfoMap) {
             fInfo = fileInfoMap.get(fileId);
         }
-        if (fInfo == null && !virtualFiles.contains(fileId)) {
+        if (fInfo == null) {
             throw new HyracksDataException("pin called on a fileId " + fileId + " that has
not been created.");
         } else if (fInfo != null && fInfo.getReferenceCount() <= 0) {
             throw new HyracksDataException("pin called on a fileId " + fileId + " that has
not been opened.");
@@ -802,22 +800,6 @@
     }
 
     @Override
-    public int createMemFile() throws HyracksDataException {
-        if (LOGGER.isLoggable(fileOpsLevel)) {
-            LOGGER.log(fileOpsLevel, "Creating memory file in cache: " + this);
-        }
-        int fileId;
-        synchronized (fileInfoMap) {
-            fileId = fileMapManager.registerMemoryFile();
-        }
-        synchronized (virtualFiles) {
-            virtualFiles.add(fileId);
-        }
-        return fileId;
-
-    }
-
-    @Override
     public void openFile(int fileId) throws HyracksDataException {
         if (LOGGER.isLoggable(fileOpsLevel)) {
             LOGGER.log(fileOpsLevel, "Opening file: " + fileId + " in cache: " + this);
@@ -995,20 +977,6 @@
             } else {
                 return 0;
             }
-        }
-    }
-
-    @Override
-    public synchronized void deleteMemFile(int fileId) throws HyracksDataException {
-        //TODO: possible sanity chcecking here like in above?
-        if (LOGGER.isLoggable(fileOpsLevel)) {
-            LOGGER.log(fileOpsLevel, "Deleting memory file: " + fileId + " in cache: " +
this);
-        }
-        synchronized (virtualFiles) {
-            virtualFiles.remove(fileId);
-        }
-        synchronized (fileInfoMap) {
-            fileMapManager.unregisterMemFile(fileId);
         }
     }
 
@@ -1375,13 +1343,6 @@
     @Override
     public void finishQueue() {
         fifoWriter.finishQueue();
-    }
-
-    @Override
-    public void copyPage(ICachedPage src, ICachedPage dst) {
-        CachedPage srcCast = (CachedPage) src;
-        CachedPage dstCast = (CachedPage) dst;
-        System.arraycopy(srcCast.buffer.array(), 0, dstCast.getBuffer().array(), 0, srcCast.buffer.capacity());
     }
 
     @Override
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/DebugBufferCache.java
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/DebugBufferCache.java
index 6c88275..4461069 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/DebugBufferCache.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/DebugBufferCache.java
@@ -177,16 +177,6 @@
     }
 
     @Override
-    public int createMemFile() throws HyracksDataException {
-        return bufferCache.createMemFile();
-    }
-
-    @Override
-    public void deleteMemFile(int fileId) throws HyracksDataException {
-        bufferCache.deleteMemFile(fileId);
-    }
-
-    @Override
     public int getNumPagesOfFile(int fileId) throws HyracksDataException {
         return bufferCache.getNumPagesOfFile(fileId);
     }
@@ -220,12 +210,6 @@
     @Override
     public void finishQueue() {
         bufferCache.finishQueue();
-    }
-
-    @Override
-    public void copyPage(ICachedPage src, ICachedPage dst) {
-        // TODO Auto-generated method stub
-
     }
 
     @Override
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/IBufferCache.java
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/IBufferCache.java
index 27e7982..90273f4 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/IBufferCache.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/IBufferCache.java
@@ -30,15 +30,11 @@
 
     public void createFile(FileReference fileRef) throws HyracksDataException;
 
-    public int createMemFile() throws HyracksDataException;
-
     public void openFile(int fileId) throws HyracksDataException;
 
     public void closeFile(int fileId) throws HyracksDataException;
 
     public void deleteFile(int fileId, boolean flushDirtyPages) throws HyracksDataException;
-
-    public void deleteMemFile(int fileId) throws HyracksDataException;
 
     public ICachedPage tryPin(long dpid) throws HyracksDataException;
 
@@ -75,8 +71,6 @@
     public IFIFOPageQueue createFIFOQueue();
 
     public void finishQueue();
-
-    void copyPage(ICachedPage src, ICachedPage dst);
 
     void setPageDiskId(ICachedPage page, long dpid);
 
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/IFileMapManager.java
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/IFileMapManager.java
index acb4ba2..0d81776 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/IFileMapManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/IFileMapManager.java
@@ -47,7 +47,4 @@
      */
     public void unregisterFile(int fileId) throws HyracksDataException;
 
-    public int registerMemoryFile();
-
-    public void unregisterMemFile(int fileId) throws HyracksDataException;
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/TransientFileMapManager.java
b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/TransientFileMapManager.java
index 05ff825..66d54b1 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/TransientFileMapManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/TransientFileMapManager.java
@@ -72,15 +72,4 @@
         name2IdMap.put(fileRef, fileId);
     }
 
-    @Override
-    public int registerMemoryFile() {
-        Integer fileId = idCounter++;
-        id2nameMap.put(fileId, null);
-        return fileId;
-    }
-
-    @Override
-    public void unregisterMemFile(int fileId) throws HyracksDataException {
-        id2nameMap.remove(fileId);
-    }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1413
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ce8ea25a021d069e02eb15fcb80d703c06a883c
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Ian Maxon <imaxon@apache.org>

Mime
View raw message