summaryrefslogtreecommitdiffstats
path: root/relstorageif
diff options
context:
space:
mode:
authorConstantin Jucovschi <cj@ubuntu.localdomain>2009-04-24 07:20:22 -0400
committerConstantin Jucovschi <cj@ubuntu.localdomain>2009-04-24 07:20:22 -0400
commit8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 (patch)
treebd328a4dd4f92d32202241b5e3a7f36177792c5f /relstorageif
downloadrasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.gz
rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.tar.xz
rasdaman-upstream-8f27e65bddd7d4b8515ce620fb485fdd78fcdf89.zip
Initial commitv8.0
Diffstat (limited to 'relstorageif')
-rw-r--r--relstorageif/Makefile.am50
-rw-r--r--relstorageif/dbstoragelayout.hh214
-rw-r--r--relstorageif/dbstoragelayout.pgc646
-rw-r--r--relstorageif/empty.cc1
-rw-r--r--relstorageif/storageid.hh32
5 files changed, 943 insertions, 0 deletions
diff --git a/relstorageif/Makefile.am b/relstorageif/Makefile.am
new file mode 100644
index 0000000..0ed7565
--- /dev/null
+++ b/relstorageif/Makefile.am
@@ -0,0 +1,50 @@
+# -*-Makefile-*- (for Emacs)
+#
+# This file is part of rasdaman community.
+#
+# Rasdaman community is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Rasdaman community is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
+#
+# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
+# rasdaman GmbH.
+#
+# For more information please see <http://www.rasdaman.org>
+# or contact Peter Baumann via <baumann@rasdaman.com>.
+#
+# MAKEFILE FOR:
+# indexif
+#
+# COMMENTS:
+#
+##################################################################
+
+AM_CXXFLAGS=@BASEDBCXXFLAGS@
+AM_LDFLAGS=@BASEDBLDFLAGS@
+
+.SUFFIXES= .@EMBEDDEDSQLEXT@
+.@EMBEDDEDSQLEXT@.@EMBEDDEDSQLOUT@:
+ $(EMBEDDEDSQLPRECOMPILER) $@ $<
+
+
+noinst_LIBRARIES=librelstorageif.a
+librelstorageif_a_SOURCES= dbstoragelayout.hh storageid.hh empty.cc
+EXTRA_librelstorageif_a_SOURCES= dbstoragelayout.pgc
+librelstorageif_a_LIBADD= dbstoragelayout.$(OBJEXT)
+librelstorageif_a_DEPENDENCIES= dbstoragelayout.$(OBJEXT)
+
+BUILT_SOURCES= dbstoragelayout.@EMBEDDEDSQLOUT@
+
+
+CLEANFILES= dbstoragelayout.@EMBEDDEDSQLOUT@ \
+ client.bm client.dbg client.log ir.out
+
diff --git a/relstorageif/dbstoragelayout.hh b/relstorageif/dbstoragelayout.hh
new file mode 100644
index 0000000..c18beed
--- /dev/null
+++ b/relstorageif/dbstoragelayout.hh
@@ -0,0 +1,214 @@
+#ifndef _DBSTORAGELAYOUT_HH_
+#define _DBSTORAGELAYOUT_HH_
+
+#include <string>
+#include <vector>
+#include "relcatalogif/dbminterval.hh"
+#include "reladminif/dbobject.hh"
+#include "reladminif/dbref.hh"
+
+class DBStorageLayout;
+template<class T> class DBRef;
+typedef DBRef<DBStorageLayout> DBStorageLayoutId;
+
+/*
+* This file is part of rasdaman community.
+*
+* Rasdaman community is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* Rasdaman community is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
+*
+* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
+rasdaman GmbH.
+*
+* For more information please see <http://www.rasdaman.org>
+* or contact Peter Baumann via <baumann@rasdaman.com>.
+*/
+
+/****************************************************************************
+ *
+ *
+ * COMMENTS:
+ *
+ ****************************************************************************/
+
+//@ManMemo: Module: {\bf relstorageif}
+/*@Doc:
+ Each instance of the {\tt DBStorageLayout} class describes a physical
+ storage layout for an MDD object or collection.
+ Every storage parameter which is not defined using the proper set* methods will result in a default value to be returned. the supports* methods will tell if the value is a default value defined at instantiation time through the static storagemgr/StorageLayout attributes or an explicitly defined value.
+ For information on the meaning of these attributes refere to storagemgr/storagelayout
+*/
+
+class DBStorageLayout : public DBObject
+ {
+ public:
+ //@Man: Creation
+ //@{
+
+ /// Construct object that uses system defaults.
+ DBStorageLayout();
+
+ //@}
+
+ void printStatus(unsigned int level = 0,std::ostream& stream = std::cout) const;
+
+ //@Man: check operations
+ //@{
+ bool supportsTileSize() const;
+
+ bool supportsPCTMin() const;
+
+ bool supportsPCTMax() const;
+
+ bool supportsIndexSize() const;
+
+ bool supportsIndexType() const;
+
+ bool supportsTilingScheme() const;
+
+ //is checked by OId::INVALID on tilingConfiguration
+ bool supportsTileConfiguration() const;
+
+ bool supportsDataFormat() const;
+ //@}
+
+ //@Man: Get operations
+ //@{
+
+ r_Bytes getPCTMin() const;
+
+ r_Bytes getPCTMax() const;
+
+ unsigned int getIndexSize() const;
+
+ r_Index_Type getIndexType() const;
+
+ r_Tiling_Scheme getTilingScheme() const;
+
+ r_Bytes getTileSize() const;
+
+ r_Minterval getTileConfiguration() const;
+
+ r_Data_Format getDataFormat() const;
+
+ //@}
+
+ //@Man: Set operations
+ //@{
+
+ void setPCTMin(r_Bytes bytes);
+
+ void setPCTMax(r_Bytes bytes);
+
+ void setIndexSize(unsigned int entries);
+
+ void setIndexType(r_Index_Type it);
+
+ void setTilingScheme(r_Tiling_Scheme ts);
+
+ void setTileSize(r_Bytes ts);
+
+ void setTileConfiguration(const r_Minterval& tc);
+
+ void setDataFormat(r_Data_Format df);
+
+ //@}
+
+
+ //@Man: Destruction
+ //@{
+ ///
+ ~DBStorageLayout();
+ //@}
+
+ protected:
+ DBStorageLayout(const OId& id) throw (r_Error);
+
+ friend class ObjectBroker;
+
+ //@Man: Operations
+ //@{
+
+ virtual void readFromDb() throw (r_Error);
+
+ virtual void insertInDb() throw (r_Error);
+
+ virtual void deleteFromDb() throw (r_Error);
+
+ virtual void updateInDb() throw (r_Error);
+
+
+ //@}
+
+ private:
+
+ //@Man: Actual Parameters:
+ //@{
+
+ /// Name of the storage layout represented by this object
+ // char* stName;
+
+ //@Man: Index Structure:
+ //@{
+ /// Which type of index should be used
+ r_Index_Type indexType;
+
+ unsigned int indexSize;
+ //@}
+
+ //@Man: Tiling:
+ //@{
+ /// How the object should be tiled
+ r_Tiling_Scheme tilingScheme;
+
+ r_Bytes pctMin;
+
+ r_Bytes pctMax;
+
+ /// Tile size in bytes.
+ r_Bytes tileSize;
+
+ /// Default configuration of the tiles.
+ DBMintervalId tileConfiguration;
+ /**
+ Describe the shape of the tiles. For instance, [2:4,0:1,0:2].
+ The tiling will start at the point [2,0,0].
+ Tiles will be appended from there according to the tileConfig.
+ */
+ //@}
+
+ //@Man: DataFormat
+ //@{
+ /// How the tiles of the object should be compressed
+ r_Data_Format dataFormat;
+ //@}
+
+ //@}
+ bool _supportsTileSize;
+
+ bool _supportsPCTMin;
+
+ bool _supportsPCTMax;
+
+ bool _supportsIndexSize;
+
+ bool _supportsIndexType;
+
+ bool _supportsTiling;
+
+ bool _supportsDataFormat;
+
+ bool _supportsTileConfiguration;
+ };
+
+#endif
diff --git a/relstorageif/dbstoragelayout.pgc b/relstorageif/dbstoragelayout.pgc
new file mode 100644
index 0000000..f7b8910
--- /dev/null
+++ b/relstorageif/dbstoragelayout.pgc
@@ -0,0 +1,646 @@
+/*
+* This file is part of rasdaman community.
+*
+* Rasdaman community is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* Rasdaman community is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
+*
+* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
+rasdaman GmbH.
+*
+* For more information please see <http://www.rasdaman.org>
+* or contact Peter Baumann via <baumann@rasdaman.com>.
+*/
+/****************************************************************************
+ *
+ *
+ * PURPOSE:
+ * Code with embedded SQL for PostgreSQL DBMS
+ *
+ *
+ * COMMENTS:
+ * none
+ *
+ ****************************************************************************/
+
+#include "reladminif/sqlerror.hh"
+#include "raslib/rmdebug.hh"
+#include "reladminif/externs.h"
+#include "dbstoragelayout.hh"
+#include "storagemgr/sstoragelayout.hh"
+#include "reladminif/objectbroker.hh"
+
+DBStorageLayout::DBStorageLayout()
+ : DBObject(),
+ indexType(StorageLayout::DefaultIndexType),
+ indexSize(StorageLayout::DefaultIndexSize),
+ tilingScheme(StorageLayout::DefaultTilingScheme),
+ tileSize(StorageLayout::DefaultTileSize),
+ tileConfiguration(new DBMinterval()),
+ dataFormat(StorageLayout::DefaultDataFormat),
+ pctMin(StorageLayout::DefaultMinimalTileSize),
+ pctMax(StorageLayout::DefaultPCTMax),
+ _supportsTileSize(false),
+ _supportsPCTMin(false),
+ _supportsPCTMax(false),
+ _supportsIndexSize(false),
+ _supportsIndexType(false),
+ _supportsTiling(false),
+ _supportsTileConfiguration(false),
+ _supportsDataFormat(false)
+{
+ objecttype = OId::STORAGEOID;
+}
+
+DBStorageLayout::DBStorageLayout(const OId& id) throw(r_Error)
+ : DBObject(id),
+ indexType(StorageLayout::DefaultIndexType),
+ indexSize(StorageLayout::DefaultIndexSize),
+ tilingScheme(StorageLayout::DefaultTilingScheme),
+ tileSize(StorageLayout::DefaultTileSize),
+ tileConfiguration(new DBMinterval()),
+ dataFormat(StorageLayout::DefaultDataFormat),
+ pctMin(StorageLayout::DefaultMinimalTileSize),
+ pctMax(StorageLayout::DefaultPCTMax),
+ _supportsTileSize(false),
+ _supportsPCTMin(false),
+ _supportsPCTMax(false),
+ _supportsIndexSize(false),
+ _supportsIndexType(false),
+ _supportsTiling(false),
+ _supportsTileConfiguration(false),
+ _supportsDataFormat(false)
+{
+ objecttype = OId::STORAGEOID;
+ readFromDb();
+}
+
+void
+DBStorageLayout::printStatus(unsigned int level, std::ostream& stream) const
+{
+ char* indent = new char[level*2 +1];
+ for (int j = 0; j < level*2 ; j++)
+ indent[j] = ' ';
+ indent[level*2] = '\0';
+
+ stream << indent;
+ stream << "DBStorageLayout:" << endl;
+ if (supportsTileSize())
+ stream << "\tTileSize\t\t\t:";
+ else
+ stream << "\tTileSize (Def.)\t\t\t:";
+ stream << getTileSize() << endl;
+ stream << indent;
+ if (supportsPCTMin())
+ stream << "\tPCTMin\t\t:";
+ else
+ stream << "\tPCTMin (Def.)\t\t\t:";
+ stream << getPCTMin() << endl;
+ stream << indent;
+ if (supportsPCTMax())
+ stream << "\tPCTMax\t\t:";
+ else
+ stream << "\tPCTMax (Def.)\t\t\t:";
+ stream << getPCTMax() << endl;
+ stream << indent;
+ if (supportsIndexSize())
+ stream << "\tIndexSize\t\t:";
+ else
+ stream << "\tIndexSize (Def.)\t\t:";
+ stream << getIndexSize() << endl;
+ stream << indent;
+ if (supportsIndexType())
+ stream << "\tIndexType\t\t\t:";
+ else
+ stream << "\tIndexType (Def.)\t\t:";
+ stream << getIndexType() << endl;
+ stream << indent;
+ if (supportsTilingScheme())
+ stream << "\tTilingScheme\t\t\t:";
+ else
+ stream << "\tTilingScheme (Def.)\t\t:";
+ stream << getTilingScheme() << endl;
+ stream << indent;
+ if (supportsTileConfiguration())
+ stream << "\tTileConfiguration\t\t:";
+ else
+ stream << "\tTileConfiguration (Def.)\t:";
+ stream << getTileConfiguration() << endl;
+ stream << indent;
+ if (supportsDataFormat())
+ stream << "\tDataFormat\t\t\t:";
+ else
+ stream << "\tDataFormat (Def.)\t\t:";
+ stream << getDataFormat() << endl;
+ stream << indent;
+
+ delete[] indent;
+}
+
+bool
+DBStorageLayout::supportsIndexType() const
+{
+ return _supportsIndexType;
+}
+
+bool
+DBStorageLayout::supportsDataFormat() const
+{
+ return _supportsDataFormat;
+}
+
+bool
+DBStorageLayout::supportsTilingScheme() const
+{
+ return _supportsTiling;
+}
+
+bool
+DBStorageLayout::supportsTileSize() const
+{
+ return _supportsTileSize;
+}
+
+bool
+DBStorageLayout::supportsIndexSize() const
+{
+ return _supportsIndexSize;
+}
+
+bool
+DBStorageLayout::supportsPCTMin() const
+{
+ return _supportsPCTMin;
+}
+
+bool
+DBStorageLayout::supportsPCTMax() const
+{
+ return _supportsPCTMax;
+}
+
+bool
+DBStorageLayout::supportsTileConfiguration() const
+{
+ return _supportsTileConfiguration;
+}
+
+r_Index_Type
+DBStorageLayout::getIndexType() const
+{
+ return indexType;
+}
+
+r_Data_Format
+DBStorageLayout::getDataFormat() const
+{
+ return dataFormat;
+}
+
+r_Tiling_Scheme
+DBStorageLayout::getTilingScheme() const
+{
+ return tilingScheme;
+}
+
+r_Bytes
+DBStorageLayout::getTileSize() const
+{
+ return tileSize;
+}
+
+unsigned int
+DBStorageLayout::getIndexSize() const
+{
+ return indexSize;
+}
+
+r_Bytes
+DBStorageLayout::getPCTMin() const
+{
+ return pctMin;
+}
+
+r_Bytes
+DBStorageLayout::getPCTMax() const
+{
+ return pctMax;
+}
+
+r_Minterval
+DBStorageLayout::getTileConfiguration() const
+{
+ return *tileConfiguration;
+}
+
+void
+DBStorageLayout::setIndexType(r_Index_Type it)
+{
+ _supportsIndexType = true;
+ indexType = it;
+ setModified();
+}
+
+void
+DBStorageLayout::setDataFormat(r_Data_Format cs)
+{
+ _supportsDataFormat = true;
+ dataFormat = cs;
+ setModified();
+}
+
+void
+DBStorageLayout::setTilingScheme(r_Tiling_Scheme ts)
+{
+ _supportsTiling = true;
+ tilingScheme = ts;
+ setModified();
+}
+
+void
+DBStorageLayout::setTileSize(r_Bytes tsize)
+{
+ _supportsTileSize = true;
+ tileSize = tsize;
+ setModified();
+}
+
+void
+DBStorageLayout::setTileConfiguration(const r_Minterval& tc)
+{
+ _supportsTileConfiguration = true;
+ *tileConfiguration = tc;
+ setModified();
+}
+
+void
+DBStorageLayout::setIndexSize(unsigned int newindexSize)
+{
+ _supportsIndexSize = true;
+ indexSize = newindexSize;
+ setModified();
+}
+
+void
+DBStorageLayout::setPCTMin(r_Bytes newpctMin)
+{
+ _supportsPCTMin = true;
+ pctMin = newpctMin;
+ setModified();
+}
+
+void
+DBStorageLayout::setPCTMax(r_Bytes newpctMax)
+{
+ _supportsPCTMax = true;
+ pctMax = newpctMax;
+ setModified();
+}
+
+DBStorageLayout::~DBStorageLayout()
+{
+ validate();
+}
+
+/*
+TABLE RAS_STORAGE (
+ StorageId INTEGER NOT NULL UNIQUE,
+ DomainId INTEGER,
+ TileSize INTEGER,
+ PCTMin INTEGER,
+ PCTMax INTEGER,
+ IndexSize INTEGER,
+ IndexType SMALLINT,
+ TilingScheme SMALLINT,
+ DataFormat SMALLINT
+ )
+*/
+
+void
+DBStorageLayout::readFromDb() throw(r_Error)
+{
+ RMDBGENTER(5, RMDebug::module_storageif, "DBStorageLayout", "readFromDb() " << myOId);
+ EXEC SQL BEGIN DECLARE SECTION;
+ long storageid1;
+ long domainid1;
+ short domainid1ind;
+ long tilesize1;
+ short tilesize1ind;
+ long pctmin1;
+ short pctmin1ind;
+ long pctmax1;
+ short pctmax1ind;
+ long indexsize1;
+ short indexsize1ind;
+ short indextype1;
+ short indextype1ind;
+ short tilingscheme1;
+ short tilingscheme1ind;
+ short dataformat1;
+ short dataformat1ind;
+ EXEC SQL END DECLARE SECTION;
+
+ storageid1 = myOId.getCounter();
+ EXEC SQL SELECT
+ DomainId,
+ TileSize,
+ PCTMin,
+ PCTMax,
+ IndexType,
+ TilingScheme,
+ DataFormat,
+ IndexSize
+ INTO
+ :domainid1 INDICATOR :domainid1ind,
+ :tilesize1 INDICATOR :tilesize1ind,
+ :pctmin1 INDICATOR :pctmin1ind,
+ :pctmax1 INDICATOR :pctmax1ind,
+ :indextype1 INDICATOR :indextype1ind,
+ :tilingscheme1 INDICATOR :tilingscheme1ind,
+ :dataformat1 INDICATOR :dataformat1ind,
+ :indexsize1 INDICATOR :indexsize1ind
+ FROM
+ RAS_STORAGE
+ WHERE
+ StorageId = :storageid1;
+ if (SQLCODE != SQLOK)
+ {
+ check("DBStorageLayout::readFromDb() SELECT FROM RAS_STORAGE");
+ generateException();
+ }
+
+ if (domainid1ind)
+ {
+ _supportsTileConfiguration = false;
+ //((DBMinterval)*tileConfiguration) = StorageLayout::DefaultTileConfiguration;
+ *tileConfiguration = StorageLayout::DefaultTileConfiguration;
+ }
+ else
+ {
+ _supportsTileConfiguration = true;
+ tileConfiguration = OId(domainid1, OId::DBMINTERVALOID);
+ }
+
+ if (indexsize1ind)
+ {
+ _supportsIndexSize = false;
+ indexSize = StorageLayout::DefaultIndexSize;
+ }
+ else
+ {
+ _supportsIndexSize = true;
+ indexSize = indexsize1;
+ }
+
+ if (tilesize1ind)
+ {
+ _supportsTileSize = false;
+ tileSize = StorageLayout::DefaultTileSize;
+ }
+ else
+ {
+ _supportsTileSize = true;
+ tileSize = tilesize1;
+ }
+
+ if (pctmin1ind)
+ {
+ _supportsPCTMin = false;
+ pctMin = StorageLayout::DefaultMinimalTileSize;
+ }
+ else
+ {
+ _supportsPCTMin = true;
+ pctMin = pctmin1;
+ }
+
+ if (pctmax1ind)
+ {
+ _supportsPCTMax = false;
+ pctMax = StorageLayout::DefaultPCTMax;
+ }
+ else
+ {
+ _supportsPCTMax = true;
+ pctMax = pctmax1;
+ }
+
+ if (indextype1ind)
+ {
+ _supportsIndexType = false;
+ indexType = StorageLayout::DefaultIndexType;
+ }
+ else
+ {
+ _supportsIndexType = true;
+ indexType = (r_Index_Type)indextype1;
+ }
+
+ if (tilingscheme1ind)
+ {
+ _supportsTiling = false;
+ tilingScheme = StorageLayout::DefaultTilingScheme;
+ }
+ else
+ {
+ _supportsTiling = true;
+ tilingScheme = (r_Tiling_Scheme)tilingscheme1;
+ }
+
+ if (dataformat1ind)
+ {
+ _supportsDataFormat = false;
+ dataFormat = StorageLayout::DefaultDataFormat;
+ }
+ else
+ {
+ _supportsDataFormat = true;
+ dataFormat = (r_Data_Format)dataformat1;
+ }
+
+ DBObject::readFromDb();
+ RMDBGEXIT(5, RMDebug::module_storageif, "DBStorageLayout", "readFromDb() " << myOId);
+}
+
+void
+DBStorageLayout::updateInDb() throw(r_Error)
+{
+ deleteFromDb();
+ insertInDb();
+ DBObject::updateInDb();
+}
+
+void
+DBStorageLayout::insertInDb() throw(r_Error)
+{
+ RMDBGENTER(5, RMDebug::module_storageif, "DBStorageLayout", "insertInDb() " << myOId);
+ EXEC SQL BEGIN DECLARE SECTION;
+ long storageid2;
+ long domainid2;
+ short domainid2ind;
+ long tilesize2;
+ short tilesize2ind;
+ long pctmin2;
+ short pctmin2ind;
+ long pctmax2;
+ short pctmax2ind;
+ long indexsize2;
+ short indexsize2ind;
+ short indextype2;
+ short indextype2ind;
+ short tilingscheme2;
+ short tilingscheme2ind;
+ short dataformat2;
+ short dataformat2ind;
+ EXEC SQL END DECLARE SECTION;
+
+ storageid2 = myOId.getCounter();
+
+ if (supportsTileConfiguration())
+ {
+ domainid2ind = 0;
+ tileConfiguration->setPersistent(true);
+ domainid2 = tileConfiguration->getOId().getCounter();
+ }
+ else
+ {
+ domainid2ind = -1;
+ }
+
+ if (supportsTileSize())
+ {
+ tilesize2ind = 0;
+ tilesize2 = tileSize;
+ }
+ else
+ {
+ tilesize2ind = -1;
+ }
+
+ if (supportsIndexSize())
+ {
+ indexsize2ind = 0;
+ indexsize2 = indexSize;
+ }
+ else
+ {
+ indexsize2ind = -1;
+ }
+
+ if (supportsPCTMin())
+ {
+ pctmin2ind = 0;
+ pctmin2 = pctMin;
+ }
+ else
+ {
+ pctmin2ind = -1;
+ }
+
+ if (supportsPCTMax())
+ {
+ pctmax2ind = 0;
+ pctmax2 = pctMax;
+ }
+ else
+ {
+ pctmax2ind = -1;
+ }
+
+ if (supportsIndexType())
+ {
+ indextype2ind = 0;
+ indextype2 = indexType;
+ }
+ else
+ {
+ indextype2ind = -1;
+ }
+
+ if (supportsTilingScheme())
+ {
+ tilingscheme2ind = 0;
+ tilingscheme2 = tilingScheme;
+ }
+ else
+ {
+ tilingscheme2ind = -1;
+ }
+
+ if (supportsDataFormat())
+ {
+ dataformat2ind = 0;
+ dataformat2 = dataFormat;
+ }
+ else
+ {
+ dataformat2ind = -1;
+ }
+
+ EXEC SQL INSERT
+ INTO
+ RAS_STORAGE
+ (
+ StorageId,
+ DomainId,
+ TileSize,
+ PCTMin,
+ PCTMax,
+ IndexType,
+ TilingScheme,
+ DataFormat,
+ IndexSize
+ )
+ VALUES (
+ :storageid2,
+ :domainid2 INDICATOR :domainid2ind,
+ :tilesize2 INDICATOR :tilesize2ind,
+ :pctmin2 INDICATOR :pctmin2ind,
+ :pctmax2 INDICATOR :pctmax2ind,
+ :indextype2 INDICATOR :indextype2ind,
+ :tilingscheme2 INDICATOR :tilingscheme2ind,
+ :dataformat2 INDICATOR :dataformat2ind,
+ :indexsize2 INDICATOR :indexsize2ind
+ );
+ if (SQLCODE != SQLOK)
+ {
+ check("DBStorageLayout::insertInDb() INSERT INTO RAS_STORAGE");
+ generateException();
+ }
+
+ DBObject::insertInDb();
+
+ RMDBGEXIT(5, RMDebug::module_storageif, "DBStorageLayout", "insertInDb() " << myOId);
+}
+
+void
+DBStorageLayout::deleteFromDb() throw(r_Error)
+{
+ RMDBGENTER(5, RMDebug::module_storageif, "DBStorageLayout", "deleteFrom() " << myOId);
+ EXEC SQL BEGIN DECLARE SECTION;
+ long storageid3;
+ EXEC SQL END DECLARE SECTION;
+
+ storageid3 = myOId.getCounter();
+
+ EXEC SQL DELETE FROM RAS_STORAGE WHERE StorageId = :storageid3;
+ if (SQLCODE != SQLOK)
+ {
+ check("DBStorageLayout::deleteFrom() DELETE FROM RAS_STORAGE");
+ generateException();
+ }
+
+ tileConfiguration->setPersistent(false);
+ DBObject::deleteFromDb();
+
+ RMDBGEXIT(5, RMDebug::module_storageif, "DBStorageLayout", "deleteFrom() " << myOId);
+}
diff --git a/relstorageif/empty.cc b/relstorageif/empty.cc
new file mode 100644
index 0000000..8246d58
--- /dev/null
+++ b/relstorageif/empty.cc
@@ -0,0 +1 @@
+/* This file helps automake to include a .cc.o rule. It's not supposed to contain anything except this comment. */
diff --git a/relstorageif/storageid.hh b/relstorageif/storageid.hh
new file mode 100644
index 0000000..ec70b2c
--- /dev/null
+++ b/relstorageif/storageid.hh
@@ -0,0 +1,32 @@
+/*
+* This file is part of rasdaman community.
+*
+* Rasdaman community is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* Rasdaman community is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
+*
+* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
+rasdaman GmbH.
+*
+* For more information please see <http://www.rasdaman.org>
+* or contact Peter Baumann via <baumann@rasdaman.com>.
+*/
+#ifndef _STORAGEID_HH_
+#define _STORAGEID_HH_
+
+class DBStorageLayout;
+
+template <class T> class DBRef;
+
+typedef DBRef<DBStorageLayout> DBStorageLayoutId;
+
+#endif