KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > datasystem > persistentsystem > _RecordCluster


1 package com.daffodilwoods.daffodildb.server.datasystem.persistentsystem;
2
3
4 import com.daffodilwoods.database.resource.DException;
5 import com.daffodilwoods.daffodildb.server.sql99.utils._Reference;
6 import com.daffodilwoods.daffodildb.utils.BufferRange;
7
8 /**
9  * Record Cluster is the only entity which has the ability to understand that whether a cluster bytes
10  * has Fixed Records or Variable Records
11
12
13  */

14  public interface _RecordCluster {
15    int FAILED = 0;
16    int PARTIAL = 1;
17    int SUCCESSFUL = 2;
18    /*
19      insert will return the an array having the result of the insert
20      0th position will be storing the result ie failed, partial or successful
21      1st pos`ition will be storing the number of column written in case of partial
22    */

23    int[] insert(byte[] columnBytes,int startColumnPosition, boolean isUpdate) throws DException;
24
25    /* update will return the an array having the result of the update
26      0th position will be storing the result ie failed, partial or successful
27      1st position will be storing the number of column written in case of partial
28
29      columnIndex can be null;
30    */

31    void update(short recordNumber,byte[] columnBytes) throws DException;
32
33    /* function will mark the given recordNumber as deleted */
34    ClusterStatus delete(short recordNumber, boolean checkKeyValidity) throws DException;
35
36
37    /* function will return the number of records in this cluster*/
38
39    com.daffodilwoods.daffodildb.utils.BufferRange retrieveBufferRange(short recordNumber) throws DException;
40
41
42    Object JavaDoc [] partialRetrieve(short recordNumber) throws DException;
43
44    short getRecordCount()throws DException;
45
46
47    short getActiveRecordCount();
48
49    Cluster getCluster()throws DException;
50
51    void setCluster(Cluster cluster0) throws DException ;
52
53    void checkValidity(short recordNumber) throws DException;
54
55
56    int getLength0fPartialRecord(short recordNumber) throws DException;
57
58    boolean isComplete(short recordNumber)throws DException;
59
60    int partialUpdate(short recordNumber, int startPosition, byte [] newBytes) throws DException ;
61
62    int getRange() throws DException;
63
64    ClusterStatus partialDelete(short recordNumber) throws DException;
65
66    int freeSpace() throws DException;
67
68 }
69
Popular Tags