Skip to content

Commit

Permalink
working on debugging whether AOF exists...
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell-Tran committed Jun 4, 2024
1 parent 7347b42 commit 59dc4dc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions go/cmd/gcsobjtable/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,17 @@ func NewGCSObjServer(flushIntervalSec int) *GCSObjServer {
func (s *GCSObjServer) flushToDisk() error {
s.mu.Lock()
defer s.mu.Unlock()
garbage_collect := false // TODO: REMOVE HARDCODED
flush_to_AOF_instead := true // TODO: REMOVE HARDCODED
aof_filename := "./aof.txt" // TODO: REMOVE HARDCODED
garbage_collect := false // TODO: REMOVE HARDCODED
flush_to_AOF := true // TODO: REMOVE HARDCODED
aof_filename := "./aof.txt" // TODO: REMOVE HARDCODED

if flush_to_AOF_instead {
WriteObjectLocationsToAOF(aof_filename, s.objectLocations)
// Can either flush to append-only file or to DB
if flush_to_AOF {
err := WriteObjectLocationsToAOF(aof_filename, s.objectLocations)
if err != nil {
return err
}
log.Printf("Successfully flushed to AOF!")
} else {
// Flush to SQLite3 Disk Database
err := insertOrUpdateObjectLocations(s.database, s.objectLocations)
Expand Down

0 comments on commit 59dc4dc

Please sign in to comment.