Upload
others
View
7
Download
0
Embed Size (px)
Citation preview
SimpleDB OverviewCSE444– Section1
1
Today…
• DemoGit/EclipseSetup• GothroughanoverviewofSimpleDB
2
LocalRepository/home/jortiz16
GitLab IndividualRepositorygit@.../simple-db-jortiz16
GitLab CourseRepositorygit@.../simple-db
Forked(byus)
Origin RemoteCloned(byyou)
Upstream RemoteAdded(byyou)
git pushgit pull
git pullupstreammaster
Git
3
WhatyoushouldNOTdo:
•Modifygivenclasses• Removing,renaming,relocatingtootherpackages
•Modifygivenmethods• Changingparametersorreturntypes
• Usethird-partylibraries• Excepttheonesunderlib/directory• YoucandoeverythingusingregularJavalibraries
4
WhatyouCANdo:
• Addnewclasses/interfaces/methods/packages•Watchoutfornameconflictswithfuturelabs!• Saferchoice:usenewpackages(best)orinnerclasses(meh)
• Re-implementprovidedmethods• Justdon’tdestroycorrectnessorspecification!
• Findbugs!
5
• Systemtestcases• Undertest/systemtest•We’llgradeusingadditionaltests
•Writeup• Explainwhydoyouimplementinthatway
•We’llreadyourcode• Readinghorriblecodeishorrible,sospendsometimepolishing• Passingallthetestcasesmaynotnecessarymeanyou’llgetahighscore
6
WhatyouCANdo(continued):
SettingupSimpleDBAnyquestionsorconcerns?
7
OverviewofSimpleDB
8
Database
•Asingledatabase• Oneschema• Listoftables
•Referencestomajorcomponents• GlobalinstanceofCatalog• GlobalinstanceofBufferPool
9
Catalog
•Storesmetadataabouttablesinthedatabase• voidaddTable(DbFile d,TupleDesc d)• DbFile getTable(int tableid)• TupleDesc getTupleDesc(int tableid)• …
•NOTpersistedtodisk• CataloginfoisreloadedeverytimeSimpleDB startsup
10
BufferPool
•TheONLYbridgebetweendata-processingoperatorsandactualdatafiles• Strictinterfaceforphysicalindependence!
•Datafilesareneveraccesseddirectly• Laterlabs:• Lockingfortransactions• Flushingpagesforrecovery
11
DataTypes
•Integer• Type.INT_TYPE• 4bytewidth
•Fixed-lengthStrings• Type.STRING_TYPE• 128byteslong(Type.STRING_LEN)• Donotchangethisconstant!
12
DbIterator
•Ancestorclassforalloperators• Join,Project,SeqScan,etc…
•Eachoperatorhasmethods:• open(),close(),getTupleDesc(),hasNext(),next(),rewind()
• Iteratormodel:chainiteratorstogether
13
HeapFile
•Mainclassthatorganizesthephysicalstorageoftables•CollectionofHeapPages ondisk• OneHeapFile foreachtable• Fixed-sizepagesmeansefficientlookupofpages
HeapPage #1
HeapPage #2
HeapPage #3
14
15
HeapPage
•A chunkofdatathatcanresideintheBufferPool•Format:Header+Tuples• #of1bitsinBitmap=#ofactivetuplesonpage
•Fixedsize:BufferPool.PAGE_SIZE Header Bitmap
Tuple #1
Tuple #2
.
.
.16
Questions?
17