checkpoint of the local resource repository

git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_lsm_tree@1920 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResource.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResource.java
index 62be750..16e249e 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResource.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResource.java
@@ -20,7 +20,7 @@
     public long getResourceId();
 
     public String getResourceName();
-    
+
     public Object getResourceObject();
 
     public ILocalResourceClass getResourceClass();
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceClass.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceClass.java
index 8aed21f..369f5b9 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceClass.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceClass.java
@@ -14,16 +14,18 @@
  */
 package edu.uci.ics.hyracks.storage.common.file;
 
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+
 public interface ILocalResourceClass {
-    
+
     public static final int LSMBTree = 0;
     public static final int LSMRTree = 1;
     public static final int LSMInvertedIndex = 2;
 
-    public byte[] serialize(ILocalResource resource);
-    
-    public ILocalResource deserialize(byte[] bytes);
-    
+    public byte[] serialize(ILocalResource resource) throws HyracksDataException;
+
+    public ILocalResource deserialize(byte[] bytes) throws HyracksDataException;
+
     public int getResourceClassId();
-    
+
 }
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceRepository.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceRepository.java
index 147fe07..86e4188 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceRepository.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/ILocalResourceRepository.java
@@ -19,7 +19,7 @@
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
 
 public interface ILocalResourceRepository {
-    
+
     public ILocalResource getResourceById(long id) throws HyracksDataException;
 
     public ILocalResource getResourceByName(String name) throws HyracksDataException;
@@ -29,7 +29,7 @@
     public void deleteResourceById(long id) throws HyracksDataException;
 
     public void deleteResourceByName(String name) throws HyracksDataException;
-    
+
     public List<ILocalResource> getAllResources() throws HyracksDataException;
 
 }
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepository.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepository.java
index eebeafe..6934124 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepository.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepository.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
 package edu.uci.ics.hyracks.storage.common.file;
 
 import java.io.ByteArrayInputStream;
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepositoryFactory.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepositoryFactory.java
index 162709f..4125d85 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepositoryFactory.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IndexLocalResourceRepositoryFactory.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
 package edu.uci.ics.hyracks.storage.common.file;
 
 public class IndexLocalResourceRepositoryFactory implements ILocalResourceRepositoryFactory {
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResource.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResource.java
deleted file mode 100644
index 27a021d..0000000
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResource.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package edu.uci.ics.hyracks.storage.common.file;
-
-public class LSMBTreeLocalResource implements ILocalResource {
-    private static final long serialVersionUID = -8638308062094620884L;
-    private final long resourceId;
-    private final String resourceName;
-    private final Object object;
-    private final LSMBTreeLocalResourceClass resourceClass;
-
-    public LSMBTreeLocalResource(long resourceId, String resourceName, Object object,
-            LSMBTreeLocalResourceClass resourceClass) {
-        this.resourceId = resourceId;
-        this.resourceName = resourceName;
-        this.object = object;
-        this.resourceClass = resourceClass;
-    }
-
-    @Override
-    public long getResourceId() {
-        return resourceId;
-    }
-
-    @Override
-    public String getResourceName() {
-        return resourceName;
-    }
-
-    @Override
-    public Object getResourceObject() {
-        return object;
-    }
-
-    @Override
-    public ILocalResourceClass getResourceClass() {
-        return resourceClass;
-    }
-
-}
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResourceClass.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResourceClass.java
index 7a73327..7624e40 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResourceClass.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/LSMBTreeLocalResourceClass.java
@@ -1,23 +1,28 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
 package edu.uci.ics.hyracks.storage.common.file;
 
-public class LSMBTreeLocalResourceClass implements ILocalResourceClass {
+public class LSMBTreeLocalResourceClass extends AbstractIndexLocalResourceClass {
+    private static LSMBTreeLocalResourceClass instance = new LSMBTreeLocalResourceClass();
 
-    @Override
-    public byte[] serialize(ILocalResource resource) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-    
-    @Override
-    public ILocalResource deserialize(byte[] bytes) {
-        // TODO Auto-generated method stub
-        return null;
+    public static LSMBTreeLocalResourceClass getInstance() {
+        return instance;
     }
 
     @Override
     public int getResourceClassId() {
-        // TODO Auto-generated method stub
-        return 0;
+        return ILocalResourceClass.LSMBTree;
     }
-
 }