-
Notifications
You must be signed in to change notification settings - Fork 0
/
Readme.txt
219 lines (173 loc) · 6.97 KB
/
Readme.txt
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
Team Members :
Zankruti Desai(zndesai)
Rushi Bhatt(rbhatt)
Khelan Patel(kjpatel4)
Navjot Singh(nsingh9)
************************************************************************************
The files that were modified are,
Task-1
FileMgr.java
RemoteConnectionImpl.java
Task-2
Buffer.java
BufferMgr.java
BasicBufferMgr.java
Test.java
Buffer.java.
Addition of buffer index and variables to count read and write
BasicBufferMgr.java
We have create a HashMap fro bufferPoolMap.
Modified chooseUnpinnedBuffer function with the replacement policy with Most Recently Modified (MRM)
created a function getBufferStatistics() to return useful statistics information like number of times buffers are read and written
Test.java
We have implemented testing as per the cases mentioned in the doc file provided
FileMgr.java
Implemented getFileStatistics() method. Created two static variables and incremented those in synchronized() read/write.
RemoteConnectionImpl.java
executed when SQL query is executed every-time. Created the object of SimpleDB.fileMgr().getFileStatistics() and called.
************************************************************************************
How to execute files for tasks.
Task-1:
1) Start the simpleDB server.
2) execute the Test.java file (which contains the test cases to check) as per,
java -cp <Path to sampled folder>/SimpleDB simpledb.server.Test simpleDB;
Note : this file can be modified to add the test cases that you wish to execute)
Task-2:
1) Start the simpleDB server.
2) execute any of the simpleDBClient files (we executed from Eclipse).
3) check output on the terminal screen.
************************************************************************************
Output:
Task-1 (as shown on terminal while executing the SQL query) :
transaction 10 committed
new transaction: 11
Total number of read blocks: 2162
Total number of written blocks: 57
--------1
transaction 11 rolled back
new transaction: 12
Total number of read blocks: 2163
Total number of written blocks: 59
transaction 12 committed
Task-2 (as shown on terminal while executing the Test.java file as per programming instructions):
Buffer which is choosen for replacement ------- 1
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 0
Read Count -----------------------466
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 2
Read Count -----------------------616
Write Count ----------------------0
Log Sequence Number ---------------1
-----------------------------------------------------------------
Buffer which is choosen for replacement ------- 0
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 2
Read Count -----------------------616
Write Count ----------------------0
Log Sequence Number ---------------1
-----------------------------------------------------------------
Buffer which is choosen for replacement ------- 2
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------0
Log Sequence Number ---------------1
-----------------------------------------------------------------
--------0
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------0
Log Sequence Number ---------------1
-----------------------------------------------------------------
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------1
Log Sequence Number --------------12
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------0
Log Sequence Number ---------------1
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------0
Log Sequence Number ---------------1
-----------------------------------------------------------------
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------1
Log Sequence Number --------------12
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------1
Log Sequence Number --------------15
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------0
Log Sequence Number ---------------1
-----------------------------------------------------------------
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------1
Log Sequence Number --------------12
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------1
Log Sequence Number --------------15
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------1
Log Sequence Number --------------30
-----------------------------------------------------------------
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------1
Log Sequence Number --------------12
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------1
Log Sequence Number --------------15
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------1
Log Sequence Number --------------30
-----------------------------------------------------------------
Statistics for the Buffer ------- 1
Read Count -----------------------762
Write Count ----------------------1
Log Sequence Number --------------12
Statistics for the Buffer ------- 0
Read Count -----------------------467
Write Count ----------------------1
Log Sequence Number --------------15
Statistics for the Buffer ------- 2
Read Count -----------------------617
Write Count ----------------------1
Log Sequence Number --------------30
************************************************************************************