Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2835)

Issue 17550044: code review 17550044: leveldb: create the DB if it doesn't already exist. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by nigeltao
Modified:
10 years, 6 months ago
Reviewers:
bradfitz
CC:
bradfitz, golang-dev
Visibility:
Public.

Description

leveldb: create the DB if it doesn't already exist. Add a FileSystem.Stat method and change memfs' errors to satisfy os.IsNotExist when appropriate. Add a ErrorIfDBExists option. The C++ code also has a CreateIfMissing option, but I feel like you'd always want to set it to true (IIUC the C++ code still writes and possibly deletes files even if you open a DB 'just for reading'), and so I've left it out of the Go options.

Patch Set 1 #

Patch Set 2 : diff -r d805962bdce8 https://code.google.com/p/leveldb-go #

Patch Set 3 : diff -r d805962bdce8 https://code.google.com/p/leveldb-go #

Patch Set 4 : diff -r 68a2d1a28592 https://code.google.com/p/leveldb-go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -21 lines) Patch
M leveldb/compaction_test.go View 1 2 chunks +2 lines, -5 lines 0 comments Download
M leveldb/db/file.go View 1 3 chunks +8 lines, -1 line 0 comments Download
M leveldb/db/options.go View 1 3 chunks +13 lines, -0 lines 0 comments Download
M leveldb/leveldb.go View 1 3 chunks +45 lines, -1 line 0 comments Download
M leveldb/leveldb_test.go View 1 3 chunks +31 lines, -12 lines 0 comments Download
M leveldb/memfs/memfs.go View 1 2 chunks +17 lines, -1 line 0 comments Download
M leveldb/version_set.go View 1 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 3
nigeltao
Hello bradfitz@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/leveldb-go
10 years, 6 months ago (2013-10-29 07:03:33 UTC) #1
bradfitz
LGTM
10 years, 6 months ago (2013-10-29 23:34:45 UTC) #2
nigeltao
10 years, 6 months ago (2013-10-30 01:53:58 UTC) #3
*** Submitted as
https://code.google.com/p/leveldb-go/source/detail?r=01e062dd7adc ***

leveldb: create the DB if it doesn't already exist.

Add a FileSystem.Stat method and change memfs' errors to satisfy
os.IsNotExist when appropriate.

Add a ErrorIfDBExists option. The C++ code also has a CreateIfMissing
option, but I feel like you'd always want to set it to true (IIUC the
C++ code still writes and possibly deletes files even if you open a
DB 'just for reading'), and so I've left it out of the Go options.

R=bradfitz
CC=golang-dev
https://codereview.appspot.com/17550044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b