Commit Graph

39 Commits

Author SHA1 Message Date
Paul Lindner 84b2c6b3e4 all: various lint fixes
- correct logging that logged functions instead of their value
- use ID vs Id naming
- use correct function names in comments

Change-Id: I61562cef7ebac7337ec6c85312cdf7915cb1a84b
2018-02-05 11:59:00 -08:00
Paul Lindner 459c75410e all: more renaming of Camlistore to Perkeep
Change-Id: I118e3cbcf20d80afeffc84f001388c4556f21628
2018-01-30 03:02:56 -08:00
Brad Fitzpatrick 66db09453f blobserver: add context to BlobRemover
Updates #733

Change-Id: I2fffb5cad59aa994441ee82ac5d940270113ee5a
2018-01-19 09:54:46 -08:00
Brad Fitzpatrick 194d4f9443 blobserver, all: add contexts to ReceiveBlob, Fetch & million resulting deps
I had intended for this to be a small change.

I was going to just add context.Context to the BlobReceiver interface,
but then I saw blob.Fetcher could also use one, so I decided to do two
in one CL.

And then it got a bit infectious and ended up touching everything.

I ended up doing SubFetch in the process by necessity.

At a certain point I finally started using context.TODO() in a few
spots, but not too many. But removing context.TODO() will come in the
future. There are more blob storage interfaces lacking context, too,
like RemoveBlobs.

Updates #733

Change-Id: Idf273180b3f8e397ac5929c6d7f520ccc5cdce08
2018-01-18 16:22:16 -08:00
Brad Fitzpatrick 0e8980b54b blobserver: change BlobStatter interface, simplify proxycache
This addresses a long-standing TODO in the BlobStatter interface to
clean it up. Just like all new Go programmers, I misused channels in
APIs. I should've cleaned this up years ago.

While here, I also added a context.

The rest should get contexts later.

This also cleans up a few things here & there.

The pkg/client statting no longer does batching, which added a lot of
complexity. There was a comment saying something like "once we have
SPDY, we can delete this". Well, we have HTTP/2 now, so seems
deletable.

All tests pass.

Change-Id: I034ce07d9b70e5cc9e5482213368993e638d4bc8
2018-01-08 16:54:52 -08:00
Brad Fitzpatrick 57648c6b83 all: update copyright holder from Google Inc to The Perkeep Authors
The AUTHORS file is the list of copyright holders.
2018-01-03 16:52:49 -08:00
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
Part of the project renaming, issue #981.

After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.

This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.

Also, this only moves the lru package to internal. More will move to
internal later.

Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.

This updates some docs, but not all.

devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).

Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
2018-01-01 16:03:34 -08:00
Paul Lindner b09cd377d7 Switch to stdlib context from golang.org/x/net/context
This switches most usages of the pre-1.7 context library to use the
standard library.  Remaining usages are in:

  app/publisher/main.go
  pkg/fs/...

Change-Id: Ia74acc39499dcb39892342a2c9a2776537cf49f1
2017-11-26 01:12:26 -08:00
mpl fa2e1103c0 blobserver/interface: fix context documentation
Change-Id: I2bbcb88771dd917c378b1dd660205048298dae62
2015-12-14 21:50:23 +01:00
Tamás Gulácsi 9f7e1df32b Remove pkg/context
Use golang.org/x/net/context instead.

Fixes #648.

Change-Id: I676a2f25458be97610a49d6f954f2102cbd373fa
2015-12-12 23:09:02 +01:00
Brad Fitzpatrick 9040f94d1f blobserver: fix errant word in comment
Change-Id: Ibd8b5f0a68ee28827f2fe1bffcee2e78b494ce06
2015-04-13 20:38:40 +02:00
mpl b6eb85631c blob SubFetcher: explicitely states with errors the testSubFetcher constraints
testSubFetcher in blobserver/storagetest was already checking that we'd
get specific error messages in the case of negative input parameters or
an out of range offset.

This change rationalizes these constraints with named errors
(ErrNegativeSubFetch and ErrOutOfRangeOffsetSubFetch) specified
in the SubFetcher interface.

It also fixes the googlestorage and s3 implementations so that they pass
the aforementioned test.

Change-Id: I25b72b842855b90ee3cab44c90654581dccf4b8e
2015-02-26 15:18:27 +01:00
Brad Fitzpatrick 73063c70ab blobserver: add WholeRefFetcher interface
Change-Id: I5807918b9e362b098d6633f6c25e94f719cf4104
2015-02-04 21:03:08 -08:00
Brad Fitzpatrick a050f78a93 blobserver: add TODO about simplifying the BlobEnumerator interface
Change-Id: I9d48337543fd22772b2019ee3d6246603cf8ed36
2014-12-30 22:37:09 -08:00
Brad Fitzpatrick a082382f33 blobserver: simplify interface more, add NewMultiBlobStreamer, storagetest func
This is round two of simplifying the BlobStreamer interface. The
continuation tokens are now sent per-item. This permits the following
item (NewMultiBlobStreamer) but also simplifies the return value (only
returns an error now) and permits the use of buffered channels as the
destination without getting out of sync.

The new NewMultiBlobStreamer is like io.MultiReader, but for
BlobStreamers, letting them be stitched together. This will be used by
the blobpacked storage layer to simplify its code, so it doesn't need
to deal with the handoff between loose and packed blobs itself.  This
MultiBlobStreamer needs a 1 element buffer, which wasn't compatible
with the old BlobStreamer interface, hence the change to include the
continuation tokens with the blob on the channel.

Finally, add a new storagetest function for testing any blobstreamer
and use it for NewMultiBlobStreamer, diskpacked, and later in
blobpacked.

Updates #532

Change-Id: Iccffed289adec93ca5100c7ef8b0a8d57e05833c
2014-12-23 17:49:12 -08:00
Brad Fitzpatrick 37001fa359 blobserver: simplify BlobStreamer interface, remove limitBytes
The caller can count on its own and cancel the context.

Also, I realize again that there's no HTTP interface for this yet, since
I didn't need to update one.

Change-Id: Ie3129bdb0dbc977c1803f18288e4d1e52e2d8478
2014-12-22 06:02:57 +13:00
Brad Fitzpatrick 31f3161b53 expand BlobStreamer docs a bit
Change-Id: Icad9348d4d3efba2b9f1c04ce982f7c453e366bb
2014-09-08 19:12:47 -07:00
Brian Gitonga Marete 21753c9350 pkg/blobserver: Modify the definition of the BlobStreamer interface.
Code implementing this interface will use NewBlob(), which has been
modified to return a pointer to blob.Blob. So change the StreamBlobs
function in this interface to also send *.blob.Blob

Change-Id: Ia3b94c3f41f95cb31e96762d4c39b3172cc978f2
2014-04-23 17:43:15 +03:00
Brad Fitzpatrick bf94a73859 Get rid of SeekFetcher vs StreamingFetcher distinction and complexity.
StreamingFetcher is now just Fetcher, and its FetchStreaming is now
just Fetch.

SeekFetcher is gone. Blobs are max 16 MB anyway, so we can slurp to
memory when needed. The main thing that cared about SeekFetcher
was the GET handler, ServeBlobref, because http.ServeContent needed
one for range requests. That's rewritten in an earlier commit, using
the FakeSeeker from another earlier commit.

Lot of code got simpler as a result.

Change-Id: Ib819413e48a8f9b8d97f596d0fbf771dab211f11
2014-03-14 12:29:13 -07:00
Tamás Gulácsi 36643ff986 Fix Fetch -> FetchStreaming conversion
As blob.fetcherToSeekerWrapper.Fetch erroneously asserts that FetchStreaming
returns a ReadSeekCloser everytime, it had to be changed.

Move MaxBlobSize from blobserver to constants (new package).

Change-Id: I4b4f22c302cbec84d77d21454e0c9e8aebdf73e5
2014-01-06 18:56:39 +01:00
Brian Gitonga Marete 92cedc3f72 pkg/blobserver: Introduce a BlobStreaming interface.
This commit introduces the basic API required to implement
high-throughput blob streaming functionality within the various blob
storage engines.

Change-Id: Ie170d11b229196617f96b298f864ad12af62c363
2013-12-25 13:18:40 +03:00
Brad Fitzpatrick a11ff22b8e camlistored: add --reindex flag; make sqlkv a sorted.Wiper
Change-Id: I6b16c1c32187fb754d3acdbe852d02a506236078
2013-12-23 19:07:17 -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
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 2a781196e7 Add BlobHub.AddReceiveHook; clean up docs, clarify how to use BlobReceiver.
Change-Id: Icc5b55fcbabc852c7cacc9a806f12098d5e59377
2013-11-23 11:09:06 -08:00
Brad Fitzpatrick 70475701d1 Get rid of QueueCreator and all its associated complexity.
Previous TODO entry was:

-- Get rid of QueueCreator entirely. Plan:
     -- sync handler still has a source and dest (one pair) but
        instead of calling CreateQueue on the source, it instead
        has an index.Storage (configured via a RequiredObject
        so it can be a kvfile, leveldb, mysql, postgres etc)
     -- make all the index.Storage types be instantiable
        from a jsonconfig Object, perhaps with constructors keyed
        on a "type" field.
     -- make sync handler support blobserver.Receiver (or StatReceiver)
        like indexes, so it can receive blobs.  but all it needs to
        do to acknowledge the ReceiveBlob is write and flush to its
        index.Storage. the syncing is async by default. (otherwise callers
        could just use "replica" if they wanted sync replication).
        But maybe for ease of configuration switching, we could also
        support a sync mode.  when it needs to replicate a blob,
        it uses the source.
     -- future option: sync mirror to an alternate path on ReceiveBlob
        that can delete. e.g. you're uploading to s3 and google,
        but don't want to upload to both at once, so you use the localdisk
        as a buffer to spread out your upstream bandwidth.
     -- end result: no more hardlinks or queue creator.

Change-Id: I6244fc4f3a655f08470ae3160502659399f468ed
2013-11-22 14:33:31 -08:00
Brad Fitzpatrick 4a6d87af41 blobserver: rearrange interface.go a bit; add ShutdownStorage
Change-Id: Idbcbf4211331e9b53185e9dd951a174c06c9215c
2013-08-26 21:06:36 -05:00
Brad Fitzpatrick ae20a0f7de Ditch App Engine ContextWrapper noise; add test that App Engine always compiles.
I had broken App Engine in my previous commit, since it wasn't part of 'make presubmit'

Change-Id: I32c25efbc7c348ff516128c87b6e817ae0685386
2013-08-21 18:51:10 -05:00
Brad Fitzpatrick b24cad68dd Cleanup: remove BlobHub and time.Duration waits from storage interface
Move up a layer to the HTTP.  Also, start to remove ContextWrapper
stuff.  We've done it differently for App Engine instead, and will do
it differently yet moving forward.

Also add blobserver.Receive and use it in most places, moving checksum
verification up a layer.

Bunch of other cleanup and TODO fixing too.

Much simpler and cleaner.

Change-Id: I12e56c5d4e53bfcf82bdd8fb0b6d57c248ff605c
2013-08-21 13:57:28 -07:00
Brad Fitzpatrick 0bdf20884b all: delete pkg/blobref; convert all from *blobref.BlobRef to new blob.Ref
Change-Id: Id2dfb7f19452bedf4f3c9310b36227fd8117b225
2013-08-03 19:54:30 -07:00
Brad Fitzpatrick 9468e5ba70 More docs. Every package is documented now.
misc.CountingReader moves into readerutil.

pkg/atomics is folded into pkg/types.

pkg/test/testdep is folded into pkg/test, with better name/docs.

Old cruft from pkg/webserver is deleted.

Change-Id: I3f72d8b29804254ef944995fb085837c878f79f5
2013-07-07 21:12:30 -07:00
Brad Fitzpatrick 62ad21ff2e Docs and minor cleanups
Change-Id: Ibf1d69c21f53cf4b5b576a0dfefa5d0e7b26264d
2013-07-07 16:09:17 -07:00
Brad Fitzpatrick 1a8eee298a Misc cleanups and TODOs
Change-Id: I9903366427e41ebadba289bf66b294690675f78f
2012-12-31 17:36:28 -08:00
mpl ed20da7592 vivify: support in camput and upload handler.
no special credentials/auth yet.
pkg/blobserver/handlers/get.go moved to
pkg/blobserver/gethandler/get.go to avoid
a dependency loop with the json sign helper.
pkg/server/sig.go was moved to pkg/jsonsign/signhandler
because it seemed inapproriate to import in
pkg/blobserver/handlers/upload.go something from
pkg/server

Change-Id: Ifeb14512e182e8a101d4fced6d6d4184e2b9cb99
2012-12-30 23:39:22 +01:00
Brad Fitzpatrick 31094d825d blobref: make blobref.SeekerFromStreamingFetcher always succeed, falling back to buffering impl
Change-Id: I370782b5f9d122b5609a98887a5780b29a40c213
2012-12-25 10:19:33 -08:00
Brad Fitzpatrick d0af61a04a Fix bugs in enumerate handler and s3's MaxEnumerateConfig.
Change-Id: Ib9cd52fe7d015a8c70416ec67ff6fd99a7a03d24
2012-12-22 13:50:55 -08:00
Brad Fitzpatrick 71d7cf9e88 Implement storage generations, init and discovery 2012-11-07 21:14:56 +01:00
Brad Fitzpatrick 610e708924 fix more references to lib/go/camli
Change-Id: Ic35c67b0255d713185e8c77fdeb91c17c79a11c7
2012-05-14 01:07:13 +10:00
Brad Fitzpatrick 0714a463c9 Update from r60 to [almost] Go 1.
A lot is still broken, but most stuff at least compiles now.

The directory tree has been rearranged now too.  Go libraries are now
under "pkg".  Fully qualified, they are e.g. "camlistore.org/pkg/jsonsign".

The go tool cannot yet fetch from arbitrary domains, but discussion is
happening now on which mechanism to use to allow that.

For now, put the camlistore root under $GOPATH/src.  Typically $GOPATH
is $HOME, so Camlistore should be at $HOME/src/camlistore.org.

Then you can:

$ go build ./server/camlistored

... etc

The build.pl script is currently disabled.  It'll be resurrected at
some point, but with a very different role (helping create a fake
GOPATH and running the go build command, if things are installed at
the wrong place, and/or running fileembed generators).

Many things are certainly broken.

Many things are disabled.  (MySQL, all indexing, etc).

Many things need to be moved into
camlistore.org/third_party/{code.google.com,github.com} and updated
from their r60 to Go 1 versions, where applicable.

The GoMySQL stuff should be updated to use database/sql and the ziutek
library implementing database/sql/driver.

Help wanted.

Change-Id: If71217dc5c8f0e70dbe46e9504ca5131c6eeacde
2012-02-18 21:53:06 -08:00