SwatDB
Loading...
Searching...
No Matches
swatdb_exceptions.h
Go to the documentation of this file.
1/*
2 * SwatDB
3 *
4 * @authors: See Contributors.doc for code contributors
5 *
6 * Copyright (c) 2020 Swarthmore College Computer Science Department
7 * Swarthmore PA, Professors Tia Newhall, Ameet Soni
8 */
9
10#ifndef _SWATDB_SWATDBEXCEOTIONS_H_
11#define _SWATDB_SWATDBEXCEOTIONS_H_
12
13
18#include <string>
19#include <exception>
20
21#include <swatdb_types.h>
22
30class SwatDBException : virtual public std::exception {
31
32 public:
33
37 explicit SwatDBException(const std::string& msg): message(msg){ }
38
42 virtual ~SwatDBException() throw() {}
43
52 virtual const char* what() const throw() {
53 return message.c_str();
54 }
55
56 protected:
57
61 std::string message;
62};
63
64
73
74 public:
75
82
87
93 FileId getFileId() const throw();
94
95 private:
96
101};
102
107
108 public:
109
115 explicit InvalidPageNumDiskMgr(PageNum page_num);
116
121
127 PageNum getPageNum() const throw();
128
129 private:
130
134 PageNum page_num;
135
136};
137
143
144 public:
145
152
157
163 FileId getFileId() const throw();
164
165 private:
166
171};
172
173
178
179 public:
180
186 explicit FileAlreadyExistDiskMgr(const std::string& file);
187
192
196 std::string getFileName() const throw();
197
198 private:
199
203 std::string file_name;
204};
205
211
212 public:
213
220
225
231 FileId getFileId() const throw();
232
233 private:
234
239};
240
241
247
248 public:
249
254
258 ~DiskErrorDiskMgr() throw() {}
259
260};
261
262
271
272 public:
273
279 explicit InvalidPageIdBufMgr(PageId page_id);
280
285
291 PageId getPageId() const throw();
292
293 private:
294
298 PageId page_id;
299};
300
306
307 public:
308
314 explicit PageNotFoundBufMgr(PageId page_id);
315
320
326 PageId getPageId() const throw();
327
328 private:
329
333 PageId page_id;
334
335};
336
344
345 public:
346
353
358
364 PageId getPageId() const throw();
365
366 private:
367
371 PageId page_id;
372
373};
374
379
380 public:
381
387 explicit PageNotPinnedBufMgr(PageId page_id);
388
393
399 PageId getPageId() const throw();
400
401 private:
402
406 PageId page_id;
407
408};
409
414
415 public:
416
422 explicit PagePinnedBufMgr(PageId page_id);
423
427 ~PagePinnedBufMgr() throw() {}
428
434 PageId getPageId() const throw();
435
436 private:
437
441 PageId page_id;
442
443};
444
445
451
452 public:
453
458
463
464};
465
466
472
473 public:
474
479
484
485};
486
496
497 public:
498
504 explicit InvalidFileTypeFileMgr(CatType file_type);
505
510
516 CatType getFileType() const throw();
517
518 private:
519
524
525};
526
531
532 public:
533
538
543
544};
545
569
570
577 public:
582
587
588};
589
590
600
601 public:
602
608 explicit FileAlreadyExistCat(const std::string& filename);
609
614
620 std::string getFileName() const throw();
621
622 private:
623
627 std::string file_name;
628};
629
630
636
637 public:
638
644 explicit NameAlreadyExistCat(const std::string& relname);
645
650
656 std::string getName() const throw();
657
658 private:
659
663 std::string name;
664};
665
666
667
672
673 public:
674
680 explicit InvalidFileIdCat(FileId file_id);
681
685 ~InvalidFileIdCat() throw() {}
686
692 FileId getFileId() const throw();
693
694 private:
695
699 FileId file_id;
700};
701
706
707 public:
708
714 explicit InvalidNameCat(const std::string& name);
715
719 ~InvalidNameCat() throw() {}
720
724 std::string getName() const throw();
725
726 private:
727
731 std::string name;
732};
733
742
743 public:
744
750 explicit InvalidSlotIdHeapPage(SlotId slot_id);
751
756
762 SlotId getSlotId() const throw();
763
764 private:
765
769 SlotId slot_id;
770
771};
772
777
778 public:
779
784
789
790};
791
792
797
798 public:
799
804
809
810};
811
817
818 public:
819
824
829 };
830
840
841 public:
842
848 explicit InvalidFileIdHeapFile(FileId file_id);
849
854
860 FileId getFileId() const throw();
861
862 private:
863
867 FileId file_id;
868
869};
870
871
877
878 public:
879
884
889
890};
891
897
898 public:
899
904
909
910};
911
920
921 public:
922
926 explicit InvalidSizeData();
927
931 ~InvalidSizeData() throw() {}
932
933};
934
940
941 public:
942
947
952
953};
954
955/************* Key class execeptions ********************/
956
962
963 public:
964
969
973 ~InvalidFormatKey() throw() {}
974
975};
976
982
983 public:
984
989
993 ~InvalidSchemaKey() throw() {}
994
995};
996
997
1003
1004 public:
1005
1010
1015
1016};
1017
1018
1019
1024
1025 public:
1026
1031
1036
1037};
1038
1044
1045 public:
1046
1051
1056
1057};
1058
1064
1065 public:
1066
1071
1076
1077};
1078
1084
1085 public:
1086
1092 explicit InvalidSlotIdHashBucketPage(SlotId slot_id);
1093
1098
1104 SlotId getSlotId() const throw();
1105
1106 private:
1107
1111 SlotId slot_id;
1112
1113};
1114
1120
1121 public:
1122
1127
1132 };
1133
1134
1140
1141 public:
1142
1148 explicit InvalidSlotHashDirPage(SlotId slot_id);
1149
1154
1160 SlotId getSlotId() const throw();
1161
1162 private:
1163
1167 SlotId slot_id;
1168
1169};
1170
1171
1176
1177 public:
1178
1183
1188 };
1189
1195
1196 public:
1197
1202
1207 };
1208
1214
1215 public:
1216
1221
1226 };
1227
1228
1234
1235 public:
1236
1241
1246 };
1247
1248
1249#endif
Definition swatdb_exceptions.h:1063
CorruptedDataHashBucketPage()
Constructor.
~CorruptedDataHashBucketPage()
Destructor.
Definition swatdb_exceptions.h:1075
Definition swatdb_exceptions.h:796
~CorruptedDataHeapPage()
Destructor.
Definition swatdb_exceptions.h:808
CorruptedDataHeapPage()
Constructor.
Definition swatdb_exceptions.h:246
DiskErrorDiskMgr()
Constructor.
~DiskErrorDiskMgr()
Destructor.
Definition swatdb_exceptions.h:258
Definition swatdb_exceptions.h:1119
EmptyDataHashBucketPage()
Constructor.
~EmptyDataHashBucketPage()
Destructor.
Definition swatdb_exceptions.h:1131
Definition swatdb_exceptions.h:816
~EmptyDataHeapPage()
Destructor.
Definition swatdb_exceptions.h:828
EmptyDataHeapPage()
Constructor.
Definition swatdb_exceptions.h:599
~FileAlreadyExistCat()
Destructor.
Definition swatdb_exceptions.h:613
std::string getFileName() const
Returns the File name of the file that already exists.
FileAlreadyExistCat(const std::string &filename)
Constructor.
Definition swatdb_exceptions.h:177
~FileAlreadyExistDiskMgr()
Destructor.
Definition swatdb_exceptions.h:191
FileAlreadyExistDiskMgr(const std::string &file)
Constructor.
std::string getFileName() const
Returns the file name of the file that already exists.
Definition swatdb_exceptions.h:210
FileIdAlreadyExistDiskMgr(FileId file_id)
Constructor.
FileId getFileId() const
Returns the FileId of the file that already exists.
~FileIdAlreadyExistDiskMgr()
Destructor.
Definition swatdb_exceptions.h:224
Definition swatdb_exceptions.h:530
FileNotFoundFileMgr()
Constructor.
~FileNotFoundFileMgr()
Destructor.
Definition swatdb_exceptions.h:542
Definition swatdb_exceptions.h:1002
~InsufficentCapacityKey()
Destructor.
Definition swatdb_exceptions.h:1014
InsufficentCapacityKey()
Constructor.
Definition swatdb_exceptions.h:450
InsufficientSpaceBufMgr()
Constructor.
~InsufficientSpaceBufMgr()
Destructor.
Definition swatdb_exceptions.h:462
Definition swatdb_exceptions.h:142
InsufficientSpaceDiskMgr(FileId file_id)
Constructor.
FileId getFileId() const
Returns the FileId of the file with insufficient space.
~InsufficientSpaceDiskMgr()
Destructor.
Definition swatdb_exceptions.h:156
Definition swatdb_exceptions.h:1043
InsufficientSpaceHashBucketPage()
Constructor.
~InsufficientSpaceHashBucketPage()
Destructor.
Definition swatdb_exceptions.h:1055
Definition swatdb_exceptions.h:1175
InsufficientSpaceHashBucket()
Constructor.
~InsufficientSpaceHashBucket()
Destructor.
Definition swatdb_exceptions.h:1187
Definition swatdb_exceptions.h:1213
InsufficientSpaceHashIndex()
Constructor.
~InsufficientSpaceHashIndex()
Destructor.
Definition swatdb_exceptions.h:1225
Definition swatdb_exceptions.h:896
InsufficientSpaceHeapFile()
Constructor.
~InsufficientSpaceHeapFile()
Destructor.
Definition swatdb_exceptions.h:908
Definition swatdb_exceptions.h:776
InsufficientSpaceHeapPage()
Constructor.
~InsufficientSpaceHeapPage()
Destructor.
Definition swatdb_exceptions.h:788
Definition swatdb_exceptions.h:1233
~InvalidEntryHashIndex()
Destructor.
Definition swatdb_exceptions.h:1245
InvalidEntryHashIndex()
Constructor.
Definition swatdb_exceptions.h:939
~InvalidFieldNameSchema()
Destructor.
Definition swatdb_exceptions.h:951
InvalidFieldNameSchema()
Constructor.
Definition swatdb_exceptions.h:671
InvalidFileIdCat(FileId file_id)
Constructor.
FileId getFileId() const
Returns the invalid FileId.
~InvalidFileIdCat()
Destructor.
Definition swatdb_exceptions.h:685
Definition swatdb_exceptions.h:72
FileId file_id
Definition swatdb_exceptions.h:100
FileId getFileId() const
Returns the invalid FileId.
InvalidFileIdDiskMgr(FileId file_id)
Constructor.
~InvalidFileIdDiskMgr()
Destructor.
Definition swatdb_exceptions.h:86
Definition swatdb_exceptions.h:839
~InvalidFileIdHeapFile()
Destructor.
Definition swatdb_exceptions.h:853
FileId getFileId() const
Returns the invalid FileId.
InvalidFileIdHeapFile(FileId file_id)
Constructor.
Definition swatdb_exceptions.h:576
InvalidFileIdRelOpsManager()
Constructor.
~InvalidFileIdRelOpsManager()
Destructor.
Definition swatdb_exceptions.h:586
Definition swatdb_exceptions.h:495
InvalidFileTypeFileMgr(CatType file_type)
Constructor.
CatType getFileType() const
Returns the PageId of the pinned Page.
~InvalidFileTypeFileMgr()
Destructor.
Definition swatdb_exceptions.h:509
Definition swatdb_exceptions.h:961
~InvalidFormatKey()
Destructor.
Definition swatdb_exceptions.h:973
InvalidFormatKey()
Constructor.
Definition swatdb_exceptions.h:1194
InvalidKeyFormatHashIndex()
Constructor.
~InvalidKeyFormatHashIndex()
Destructor.
Definition swatdb_exceptions.h:1206
Definition swatdb_exceptions.h:1023
~InvalidKeyFormatRecord()
Destructor.
Definition swatdb_exceptions.h:1035
InvalidKeyFormatRecord()
Constructor.
Definition swatdb_exceptions.h:705
std::string getName() const
Returns the invalid relation name.
InvalidNameCat(const std::string &name)
Constructor.
~InvalidNameCat()
Destructor.
Definition swatdb_exceptions.h:719
Definition swatdb_exceptions.h:270
InvalidPageIdBufMgr(PageId page_id)
Constructor.
~InvalidPageIdBufMgr()
Destructor.
Definition swatdb_exceptions.h:284
PageId getPageId() const
Returns the invalid PageId.
Definition swatdb_exceptions.h:106
~InvalidPageNumDiskMgr()
Destructor.
Definition swatdb_exceptions.h:120
InvalidPageNumDiskMgr(PageNum page_num)
Constructor.
PageNum getPageNum() const
Returns the invalid PageNum.
Definition swatdb_exceptions.h:471
InvalidPolicyBufMgr()
Constructor.
~InvalidPolicyBufMgr()
Destructor.
Definition swatdb_exceptions.h:483
Definition swatdb_exceptions.h:876
~InvalidSchemaHeapFile()
Destructor.
Definition swatdb_exceptions.h:888
InvalidSchemaHeapFile()
Constructor.
Definition swatdb_exceptions.h:981
~InvalidSchemaKey()
Destructor.
Definition swatdb_exceptions.h:993
InvalidSchemaKey()
Constructor.
Definition swatdb_exceptions.h:919
~InvalidSizeData()
Destructor.
Definition swatdb_exceptions.h:931
InvalidSizeData()
Constructor.
Definition swatdb_exceptions.h:1139
~InvalidSlotHashDirPage()
Destructor.
Definition swatdb_exceptions.h:1153
InvalidSlotHashDirPage(SlotId slot_id)
Constructor.
SlotId getSlotId() const
Returns the invalid SlotId.
Definition swatdb_exceptions.h:1083
~InvalidSlotIdHashBucketPage()
Destructor.
Definition swatdb_exceptions.h:1097
InvalidSlotIdHashBucketPage(SlotId slot_id)
Constructor.
SlotId getSlotId() const
Returns the invalid SlotId.
Definition swatdb_exceptions.h:741
~InvalidSlotIdHeapPage()
Destructor.
Definition swatdb_exceptions.h:755
SlotId getSlotId() const
Returns the invalid SlotId.
InvalidSlotIdHeapPage(SlotId slot_id)
Constructor.
Definition swatdb_exceptions.h:556
~MismatchingFieldsRelOpsManager()
Destructor.
Definition swatdb_exceptions.h:566
MismatchingFieldsRelOpsManager()
Constructor.
Definition swatdb_exceptions.h:635
std::string getName() const
Returns the name of the relation that already exists.
NameAlreadyExistCat(const std::string &relname)
Constructor.
~NameAlreadyExistCat()
Destructor.
Definition swatdb_exceptions.h:649
Definition swatdb_exceptions.h:343
PageId getPageId() const
Returns the PageId of the Page already in the buffer pool.
~PageAlreadyLoadedBufMgr()
Destructor.
Definition swatdb_exceptions.h:357
PageAlreadyLoadedBufMgr(PageId page_id)
Constructor.
Definition swatdb_exceptions.h:305
PageNotFoundBufMgr(PageId page_id)
Constructor.
~PageNotFoundBufMgr()
Destructor.
Definition swatdb_exceptions.h:319
PageId getPageId() const
Returns the PageId of the Page not found.
Definition swatdb_exceptions.h:378
~PageNotPinnedBufMgr()
Destructor.
Definition swatdb_exceptions.h:392
PageNotPinnedBufMgr(PageId page_id)
Constructor.
PageId getPageId() const
Returns the PageId of the Page not pinned.
Definition swatdb_exceptions.h:413
~PagePinnedBufMgr()
Destructor.
Definition swatdb_exceptions.h:427
PageId getPageId() const
Returns the PageId of the pinned Page.
PagePinnedBufMgr(PageId page_id)
Constructor.
SwatDBException is the base class for all exceptions thrown in SwatDB system. It is based on std::exc...
Definition swatdb_exceptions.h:30
SwatDBException(const std::string &msg)
Definition swatdb_exceptions.h:37
virtual ~SwatDBException()
Definition swatdb_exceptions.h:42
std::string message
Definition swatdb_exceptions.h:61
virtual const char * what() const
Returns the error message of the exception.
Definition swatdb_exceptions.h:52
Definition swatdb_types.h:54
std::uint32_t FileId
Definition swatdb_types.h:33
std::uint32_t PageNum
Definition swatdb_types.h:38
CatType
Definition swatdb_types.h:145