Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Issue 10168025: GDataDB support with leveldb. (Closed)

Created:
8 years, 8 months ago by achuithb
Modified:
8 years, 8 months ago
Reviewers:
satorux1, zel
CC:
chromium-reviews, achuith+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

GDataDB support with leveldb. * Define GDataDB interface with methods to Put, Get and Delete. Also define a path-based iterator. * GDataLevelDB implements GDataDB using leveldb. * Add methods SerializeToString and FromProtoString to serialize GDataEntry to strings and vice versa. * GDataDBTests test Put, Get, Delete for files and directories. * Iterator tests in GDataDBTests. * GDataDBFactory class to create GDataLevelDB instance. TODO: * There is no integration with GDataRootDirectory/GDataFileSystem yet. BUG=chromium-os:29232 TEST=unittests pass. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=133815

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : iterator support #

Patch Set 5 : fixes #

Total comments: 18

Patch Set 6 : rebase #

Patch Set 7 : #

Patch Set 8 : minor fixes #

Patch Set 9 : rebase #

Patch Set 10 : FindEntryByPath #

Total comments: 24

Patch Set 11 : satorux feedback #

Patch Set 12 : minor #

Total comments: 20

Patch Set 13 : revert FindEntryByPath #

Patch Set 14 : revert find_entry_delegate in gypi #

Patch Set 15 : more satorux feedback #

Total comments: 10

Patch Set 16 : sequence_id #

Patch Set 17 : final nits #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+736 lines, -14 lines) Patch
A chrome/browser/chromeos/gdata/gdata_db.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +69 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/gdata/gdata_db_factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +25 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/gdata/gdata_db_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +22 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/gdata/gdata_db_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +266 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +20 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_files.cc View 1 2 3 4 5 6 7 8 10 11 12 7 chunks +64 lines, -6 lines 0 comments Download
A chrome/browser/chromeos/gdata/gdata_leveldb.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +60 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/gdata/gdata_leveldb.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +204 lines, -0 lines 4 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 10 11 12 13 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
achuithb
As noted in the description, I haven't attempted to integrate with GDataFileSystem/GDataRootDirectory yet. I think ...
8 years, 8 months ago (2012-04-21 08:14:56 UTC) #1
satorux1
just took a quick look. http://codereview.chromium.org/10168025/diff/2003/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/2003/chrome/browser/chromeos/gdata/gdata_db.h#newcode19 chrome/browser/chromeos/gdata/gdata_db.h:19: class GDataDB { class ...
8 years, 8 months ago (2012-04-23 17:40:41 UTC) #2
zel
http://codereview.chromium.org/10168025/diff/13001/chrome/browser/chromeos/gdata/gdata_leveldb.cc File chrome/browser/chromeos/gdata/gdata_leveldb.cc (right): http://codereview.chromium.org/10168025/diff/13001/chrome/browser/chromeos/gdata/gdata_leveldb.cc#newcode66 chrome/browser/chromeos/gdata/gdata_leveldb.cc:66: leveldb::Slice(file.file_name()), file_name() is not unique, you should use GetFilePath() ...
8 years, 8 months ago (2012-04-23 18:44:51 UTC) #3
achuithb
Believe I've addressed all comments. PTAL, Satoru-san and Zel. http://codereview.chromium.org/10168025/diff/13001/chrome/browser/chromeos/gdata/gdata_leveldb.cc File chrome/browser/chromeos/gdata/gdata_leveldb.cc (right): http://codereview.chromium.org/10168025/diff/13001/chrome/browser/chromeos/gdata/gdata_leveldb.cc#newcode66 chrome/browser/chromeos/gdata/gdata_leveldb.cc:66: ...
8 years, 8 months ago (2012-04-24 08:09:36 UTC) #4
achuithb
Biggest changes are use of GDataEntry::GetFilePath instead of GDataEntry::file_name, and use of batch write operations ...
8 years, 8 months ago (2012-04-24 08:25:38 UTC) #5
achuithb
I've started some integration work, and the CL is getting bigger. I've moved FindEntryDelegate and ...
8 years, 8 months ago (2012-04-24 10:05:06 UTC) #6
satorux1
On 2012/04/24 10:05:06, achuith.bhandarkar wrote: > I've started some integration work, and the CL is ...
8 years, 8 months ago (2012-04-24 17:51:06 UTC) #7
satorux1
http://codereview.chromium.org/10168025/diff/33002/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/33002/chrome/browser/chromeos/gdata/gdata_db.h#newcode25 chrome/browser/chromeos/gdata/gdata_db.h:25: DB_NOT_FOUND, does this mean the db file is not ...
8 years, 8 months ago (2012-04-24 18:26:44 UTC) #8
achuithb
PTAL, Satoru-san. http://codereview.chromium.org/10168025/diff/33002/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/33002/chrome/browser/chromeos/gdata/gdata_db.h#newcode25 chrome/browser/chromeos/gdata/gdata_db.h:25: DB_NOT_FOUND, On 2012/04/24 18:26:44, satorux1 wrote: > ...
8 years, 8 months ago (2012-04-24 19:43:58 UTC) #9
achuithb
On 2012/04/24 17:51:06, satorux1 wrote: > On 2012/04/24 10:05:06, achuith.bhandarkar wrote: > > I've started ...
8 years, 8 months ago (2012-04-24 20:08:13 UTC) #10
satorux1
http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_db.h#newcode25 chrome/browser/chromeos/gdata/gdata_db.h:25: DB_NOT_FOUND, // Key not found. DB_KEY_NOT_FOUND to be more ...
8 years, 8 months ago (2012-04-24 20:25:15 UTC) #11
satorux1
http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_db.h#newcode25 chrome/browser/chromeos/gdata/gdata_db.h:25: DB_NOT_FOUND, // Key not found. DB_KEY_NOT_FOUND to be more ...
8 years, 8 months ago (2012-04-24 20:25:15 UTC) #12
satorux1
8 years, 8 months ago (2012-04-24 20:25:17 UTC) #13
achuithb
PTAL, Satoru-san. http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_db.h#newcode25 chrome/browser/chromeos/gdata/gdata_db.h:25: DB_NOT_FOUND, // Key not found. On 2012/04/24 ...
8 years, 8 months ago (2012-04-24 21:36:25 UTC) #14
satorux1
http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h#newcode46 chrome/browser/chromeos/gdata/gdata_db.h:46: // An iterator to fetch all GDataEntry's under |path|. ...
8 years, 8 months ago (2012-04-24 21:47:57 UTC) #15
achuithb
PTAL! http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h#newcode46 chrome/browser/chromeos/gdata/gdata_db.h:46: // An iterator to fetch all GDataEntry's under ...
8 years, 8 months ago (2012-04-24 22:15:13 UTC) #16
satorux1
LGTM http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h#newcode46 chrome/browser/chromeos/gdata/gdata_db.h:46: // An iterator to fetch all GDataEntry's under ...
8 years, 8 months ago (2012-04-24 22:34:50 UTC) #17
achuithb
Thanks for the review, Satoru-san! http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h File chrome/browser/chromeos/gdata/gdata_db.h (right): http://codereview.chromium.org/10168025/diff/42013/chrome/browser/chromeos/gdata/gdata_db.h#newcode46 chrome/browser/chromeos/gdata/gdata_db.h:46: // An iterator to ...
8 years, 8 months ago (2012-04-24 23:47:20 UTC) #18
zel
lgtm http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_leveldb.cc File chrome/browser/chromeos/gdata/gdata_leveldb.cc (right): http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_leveldb.cc#newcode39 chrome/browser/chromeos/gdata/gdata_leveldb.cc:39: return GDataDB::DB_CORRUPTION; what do we plan to do ...
8 years, 8 months ago (2012-04-25 00:49:47 UTC) #19
achuithb
http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_leveldb.cc File chrome/browser/chromeos/gdata/gdata_leveldb.cc (right): http://codereview.chromium.org/10168025/diff/15002/chrome/browser/chromeos/gdata/gdata_leveldb.cc#newcode39 chrome/browser/chromeos/gdata/gdata_leveldb.cc:39: return GDataDB::DB_CORRUPTION; On 2012/04/25 00:49:47, zel wrote: > what ...
8 years, 8 months ago (2012-04-25 00:57:53 UTC) #20
zel
lgtm http://codereview.chromium.org/10168025/diff/35008/chrome/browser/chromeos/gdata/gdata_leveldb.cc File chrome/browser/chromeos/gdata/gdata_leveldb.cc (right): http://codereview.chromium.org/10168025/diff/35008/chrome/browser/chromeos/gdata/gdata_leveldb.cc#newcode17 chrome/browser/chromeos/gdata/gdata_leveldb.cc:17: const char kPathPrefix[] = "path:"; On 2012/04/25 00:57:53, ...
8 years, 8 months ago (2012-04-25 01:18:33 UTC) #21
achuithb
8 years, 8 months ago (2012-04-25 01:20:26 UTC) #22
http://codereview.chromium.org/10168025/diff/35008/chrome/browser/chromeos/gd...
File chrome/browser/chromeos/gdata/gdata_leveldb.cc (right):

http://codereview.chromium.org/10168025/diff/35008/chrome/browser/chromeos/gd...
chrome/browser/chromeos/gdata/gdata_leveldb.cc:17: const char kPathPrefix[] =
"path:";
On 2012/04/25 01:18:33, zel wrote:
> On 2012/04/25 00:57:53, achuith.bhandarkar wrote:
> > On 2012/04/25 00:49:47, zel wrote:
> > > why do you need these prefixes at all?
> > 
> > We're storing paths and resource_ids in the same table (this allows us to
> batch
> > the writes for atomic updates). We use the prefix to disambiguate the 2
types
> of
> > keys.
> 
> you should shorten them to r: and p: instead... also when you wire things with
> GFS layer, drop the first part of the path because it's the same for
everything
> we store "gdata/"

Since the key is generated with GDataEntry::GetFilePath, the /gdata/ portion is
already stripped out. The keys look like
p:dir1/dir2/file1

Powered by Google App Engine
This is Rietveld 408576698