Commit Graph

26 Commits

Author SHA1 Message Date
Brad Fitzpatrick bffe14c682 diskpacked: fix dev server
Was broken in bf6bde214a

Change-Id: Ia184a7c8373e2b303cfd6e8ae6091150de1a8d15
2014-03-10 20:10:00 -07:00
Brad Fitzpatrick bf6bde214a diskpacked: optional support for alternate index sorted.KeyValue store
By default it will use cznic/kv. But if you want to use something else
(like MySQL, or leveldb, or Postgres, or Mongo), you can.

Change-Id: I8ce3571a701717ffde3b80856c72a9e3223ab439
2014-03-10 19:01:21 -07:00
Brad Fitzpatrick 260a33aa2a Make various popular storage targets be Stringers. Optional, for upcoming sync handler rewrite.
Change-Id: I8cc961ace8b6093b1dbd82bc39ba3fc334f1d5c7
2014-03-05 08:23:07 -08:00
Tamás Gulácsi 97520583b8 Use 'uint32' instead of 'int64' for blob sizes everywhere.
Not just in blob.SizedRef, but in blobserver.Fetch and
blobserver.FetchStreaming, too.
Blobs have a max size of 10-32 MB anyway, and the index.Corpus is now using
uint32 to save memory.

Change-Id: I1172445c2f9463fdaee55bfe0f1218d44be4aa53
2014-02-08 17:58:12 +01:00
Brad Fitzpatrick 4afc5d32f0 diskpacked: don't append duplicate blobs.
Change-Id: I3adce39641458a67a3cdee09bb66411dd1111acd
2014-02-07 10:46:35 -08:00
Brad Fitzpatrick 254239c379 diskpacked: add IsDir and New
Change-Id: Iba7bfa4772c494240104f4f67e4a1a946f64b6c8
2014-02-07 10:45:22 -08:00
Bill Thiede 5c884e52ca diskpacked: keep fd open to every pack file.
Bytes read/writen per pack file, as well as per configured diskpacked
configuration are now available as expvars.

Also add reader stat helpers to pkg/types and updated the original
user in server/image.go

Change-Id: Ifc9d76c57aab329d4b947e9a4ef9eac008bc608d
2014-01-20 10:50:42 -08:00
mpl ab5e385113 index: move kvfile implementation to sorted
Change-Id: Ie6e676570af088246ef028a2f003b537d85dd6ae
2013-12-13 16:59:45 +01:00
Brad Fitzpatrick 76171ddb3d Change sorted.KeyValue.Find to take an optional end bound; add tests.
The new package sorted/kvtest provides a generic KeyValue test for all
implementations. Memory, SQLite, and kvfile now use it.

This speeds up the index slurping start-up of my personal Camlistore
server from 30 seconds (when it was doing 17,000+ queries in small
windows) to now just 5 seconds. That 5 seconds can be improved yet
further.

Change-Id: Idd55ba9ccd3ed12a26868a41db1af676aff7b67b
2013-12-07 08:43:18 -08:00
Brad Fitzpatrick b82b8efe4c Start of new context package and *context.Context type.
Will eventually be plumbed through lots of APIs, especially those requiring or benefiting from
cancelation notification and/or those needing access to the HTTP context (e.g. App Engine).

Change-Id: I591496725d620126e09d49eb07cade7707c7fc64
2013-12-02 13:20:51 -08:00
Brad Fitzpatrick 6478e256f7 diskpacked: finish enumeration bug with 'after' param
Change-Id: I391a33e7672cce6c7c9a4eebc0a09c2f03546b82
2013-12-02 11:56:23 -08:00
Tamás Gulácsi f69306cbee Finish implementing storagetest
Add use into localdisk (diskpacked already uses it).
Add ErrNotImplemented error for blobserver and mention the possibility
for RemoveBlobs (diskpacked deficit).

Change-Id: I6a50f263a58c8d3d1611ff9a060ea9fa4aee6163
2013-12-01 21:05:37 +01:00
Brad Fitzpatrick f544114844 Fix diskpacked regression, add tests, start of storagetest.
Regressed from rev cb6f423e. Eventually pkg storagetest should test all methods of blobserver.Storage
for all storage target types.

Change-Id: I2c1c93b76fd9280a3eb429b1d71c64a693ed1ace
2013-11-30 13:06:04 -08:00
Brad Fitzpatrick 3fd356f457 gofmt
Change-Id: I900a49b3f76aec7ef65419f2a5ecaf3eae95defb
2013-11-28 11:58:47 -08:00
Tamás Gulácsi cb6f423eeb Add diskpacked-reindex subcommand to camtool
For checking and/or rebuilding index.kv of diskpacked packs.

Change-Id: I1ad87974b2daf58b1e767bb1df6f7b64e8b6359a
2013-11-28 20:44:27 +01:00
Bill Thiede 60e10a99ad blobserver/diskpacked: Remove TODO, close index.
https://camlistore.org/gw/1f407edd588d8ae33475818d891fc0e0058d1628 makes this
possible.

Change-Id: Ibf21f7f7d3c11139192599d6e18fa0aa5dbc7007
2013-11-24 14:28:01 -08:00
Brad Fitzpatrick 1f407edd58 sorted: add Close method to KeyValure; register 'kv' impl type for cznic/kv
Change-Id: Ie4e21450dac9dad3433c65631706f52527502cbc
2013-11-23 21:07:03 -08:00
Brad Fitzpatrick 90c1e48afe Rename index.Storage to sorted.KeyValue and move it into a new package.
Having index.Index and index.Storage both in the same package led to
confusing discussions about "an index". Better names now, and smaller
packages.
2013-11-22 23:24:54 -08:00
Brad Fitzpatrick a58dcc1e5a diskpacked: re-use fds when possible when reading blobs from pack files.
We could actually do better than this and use the fd already open
from the still-appending file, or just keep one fd open per pack
file.

But this is a start.

Change-Id: I164a9bdf44987c3f057872cc7fdee1735f9e89a9
2013-10-10 20:06:30 -10:00
Brad Fitzpatrick 6e92302b1d Fix data races added in 161fc061d3
Change-Id: I7167472de3778fc76cc54dff6c864ed43b2052e9
2013-10-10 19:54:23 -10:00
Brad Fitzpatrick 736f5d0d21 Merge "Add generation support for diskpacked." 2013-10-10 20:14:17 +00:00
Tamás Gulácsi 161fc061d3 use syncutil.Group and syncutil.Gate for paralellizing blobserver stats/removes
- where TODO exist.

Change-Id: If7340cf3bfcd5f5211f646404312c2fd15947bd9
2013-10-10 21:52:12 +02:00
Tamás Gulácsi a624b6d3b2 Add generation support for diskpacked.
Refactor the localdisk, diskpacked common code to pkg/blobserver/local
(only StorageGeneration, ResetStorageGeneration in this CL)

Change-Id: Ib04125805d5a1960bd29a474d3fc7ca985708d8d
2013-10-10 21:35:44 +02:00
Tamás Gulácsi 1cd83acccf Let diskpacked maxFileSize be configurable
And on the way, remove diskpacked.New, as unused.

Change-Id: Idd14dd08fcf0645237dda66b4fa2d6c5e6e5b3e4
2013-10-09 09:24:31 +02:00
Andrew Gerrand bcfeeb47f6 diskpacked: cleanups
Change-Id: I91566b120698b618ad4f83468a0cd4ea2c0ae765
2013-09-03 10:27:33 +10:00
Andrew Gerrand 4ca346f124 add diskpacked storage system
Change-Id: Ieb16459c06d596ad49bbe78b6e058955fcd6f649
2013-09-02 10:35:32 +10:00