File: gfarm.sql

package info (click to toggle)
gfarm 2.3.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,972 kB
  • ctags: 10,894
  • sloc: ansic: 84,510; sh: 13,707; java: 6,866; makefile: 2,286; python: 771; perl: 325; sql: 130; xml: 50; asm: 37; csh: 2
file content (143 lines) | stat: -rw-r--r-- 3,417 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
CREATE TABLE Host (
	hostname	VARCHAR(256)	PRIMARY KEY,
	port		INTEGER		NOT NULL,
	architecture	VARCHAR(128)	NOT NULL,
	ncpu		INTEGER		NOT NULL,
	flags		INTEGER		NOT NULL
);


CREATE TABLE HostAliases (
	hostalias	VARCHAR(256)	PRIMARY KEY,
	hostname	VARCHAR(256)
		REFERENCES Host(hostname) ON DELETE CASCADE
);

CREATE INDEX HostAliasesByHostname ON HostAliases (hostname);


CREATE TABLE GfarmUser (
	username	VARCHAR(64)	PRIMARY KEY,
	homedir		VARCHAR(1024)	NOT NULL,
	realname	VARCHAR(256)	NOT NULL,
	gsiDN		VARCHAR(1024)
);

CREATE TABLE GfarmGroup (
	groupname	TEXT	PRIMARY KEY
);

CREATE TABLE GfarmGroupAssignment (
	username	VARCHAR(64)
		REFERENCES GfarmUser(username) ON DELETE CASCADE,
	groupname	TEXT
		REFERENCES GfarmGroup(groupname) ON DELETE CASCADE,
	PRIMARY KEY(username, groupname)
);


CREATE TABLE INode (
	inumber		INT8		PRIMARY KEY,
	igen		INT8		NOT NULL,
	nlink		INT8		NOT NULL,
	size		INT8		NOT NULL,
	mode		INTEGER		NOT NULL,
	username	VARCHAR(64)	NOT NULL,
	groupname	TEXT		NOT NULL,
	atimesec	INT8		NOT NULL,
	atimensec	INTEGER		NOT NULL,
	mtimesec	INT8		NOT NULL,
	mtimensec	INTEGER		NOT NULL,
	ctimesec	INT8		NOT NULL,
	ctimensec	INTEGER		NOT NULL
);

CREATE TABLE FileInfo (
	inumber		INT8		PRIMARY KEY
		REFERENCES INode(inumber) ON DELETE CASCADE,
	checksumType	VARCHAR(32)	NOT NULL,
	checksum	VARCHAR(256)	NOT NULL
);

CREATE TABLE FileCopy (
	inumber		INT8		NOT NULL,
	hostname	VARCHAR(256)	NOT NULL,
	PRIMARY KEY(inumber, hostname)
);

CREATE INDEX fileCopyByINode ON FileCopy (inumber);

CREATE TABLE DeadFileCopy (
	inumber		INT8		NOT NULL,
	igen		INT8		NOT NULL,
	hostname	VARCHAR(256)	NOT NULL,
	PRIMARY KEY(inumber, igen, hostname)
);

CREATE INDEX deadFileCopyByHostname ON DeadFileCopy (hostname);

CREATE TABLE DirEntry (
	dirINumber	INT8		NOT NULL,
	entryName	VARCHAR(1024)	NOT NULL,
	entryINumber	INT8		NOT NULL,
	PRIMARY KEY(dirINumber, entryName)
);

CREATE INDEX dirEntryByINode ON DirEntry (dirINumber);

CREATE TABLE Symlink (
	inumber		INT8		PRIMARY KEY,
	sourcePath	VARCHAR(1024)	NOT NULL
);

CREATE TABLE XAttr (
	inumber		INT8		NOT NULL
		REFERENCES INode(inumber) ON DELETE CASCADE,
	attrname	VARCHAR(256)	NOT NULL,
	attrvalue	BYTEA	NOT NULL,
	PRIMARY KEY(inumber, attrname)
);

CREATE TABLE QuotaUser (
	username	VARCHAR(64)	PRIMARY KEY
		REFERENCES GfarmUser(username) ON DELETE CASCADE,
	gracePeriod	INT8	NOT NULL,
	fileSpace	INT8	NOT NULL,
	fileSpaceExceed	INT8	NOT NULL,
	fileSpaceSoft	INT8	NOT NULL,
	fileSpaceHard	INT8	NOT NULL,
	fileNum		INT8	NOT NULL,
	fileNumExceed	INT8	NOT NULL,
	fileNumSoft	INT8	NOT NULL,
	fileNumHard	INT8	NOT NULL,
	phySpace	INT8	NOT NULL,
	phySpaceExceed	INT8	NOT NULL,
	phySpaceSoft	INT8	NOT NULL,
	phySpaceHard	INT8	NOT NULL,
	phyNum		INT8	NOT NULL,
	phyNumExceed	INT8	NOT NULL,
	phyNumSoft	INT8	NOT NULL,
	phyNumHard	INT8	NOT NULL
);

CREATE TABLE QuotaGroup (
	groupname	TEXT	PRIMARY KEY
		 REFERENCES GfarmGroup(groupname) ON DELETE CASCADE,
	gracePeriod	INT8	NOT NULL,
	fileSpace	INT8	NOT NULL,
	fileSpaceExceed	INT8	NOT NULL,
	fileSpaceSoft	INT8	NOT NULL,
	fileSpaceHard	INT8	NOT NULL,
	fileNum		INT8	NOT NULL,
	fileNumExceed	INT8	NOT NULL,
	fileNumSoft	INT8	NOT NULL,
	fileNumHard	INT8	NOT NULL,
	phySpace	INT8	NOT NULL,
	phySpaceExceed	INT8	NOT NULL,
	phySpaceSoft	INT8	NOT NULL,
	phySpaceHard	INT8	NOT NULL,
	phyNum		INT8	NOT NULL,
	phyNumExceed	INT8	NOT NULL,
	phyNumSoft	INT8	NOT NULL,
	phyNumHard	INT8	NOT NULL
);