-
Notifications
You must be signed in to change notification settings - Fork 2
GDD
crazyxuehu edited this page Dec 8, 2017
·
9 revisions
GDD is the global data dictionary,which controls the meta information for the whole distributed database. Then we design the GDD structure just as follows.
public class GDD {
HashMap<String,Site>siteList;
HashMap<String,Schema>schemaList;
HashMap<String,User>userList;
}
public class Site {
int Id;
String name;
String ip;
int port;
boolean isLeader;
}
public class Schema {
String name;
int id;
List<Table>tableList;
List<Privilege>userList;
//Statics statics;
}
public class Privilege {
int use;//1,read, 3, write,5create 7,delete;
int uid;
String username;
}
public class Table {
String tablename;
int id;
HashMap<String,Column>columns;
List<Fragment>fragment;
List<Privilege>userList;
int isFragment;
Statics statics;
}
public class Column {
int id;
int dataType;
String columnName;
int len;
int index;//0:none; 1:hashindex; 2:btreeindex; 3:others
boolean isKey;
}
public class Fragment {
int fragmentType;//0: horizontal;1:vertical
List<Condition>condition;
Table subTable
int siteId;
Statics statics;
}
public class Condition {
String columnName;
int CompareType;//define less,great,equal..
String value;
int dataType;//the datatype of value
}
public class Statics {
String columnName;
String min;
String max;
String mean;
String mode;
String median;
HashMap<String,Integer>staticList;
}
public class User {
int uid;
String username;
HashMap<String,Privilege>tableList;
HashMap<String,Privilege>schemaList;
}
List<String> listTables(String db, String tblPrefix)
List<String> listTables(String db)
int createSchema(String schemaName)
int createTable(Table tableHandle)