Commit Graph

258 Commits

Author SHA1 Message Date
Brad Fitzpatrick af36d78bd7 env: add IsDev and use it everywhere
Change-Id: I5547ce989c05f1f48774f24abee41c489326baa0
2015-04-02 05:55:01 -07:00
mpl ac6acf5d70 index/sqlite tests: let sorted/sqlite pkg do initDB and enable WAL
The problem was newSorted was taking care of doing the DB
initialization. It was not only unnecessary, since newKeyValueFromConfig
from sorted/sqlite will do it by calling initDB, but also incorrect
because WAL was not getting enabled. Which is what was causing the
"database is locked" error "fixed" in commit
f6bf779cd6

Change-Id: Ib4badeda4ed4c6c4be43d5f7fc4c543a467b0cd1
2015-03-13 19:11:33 +01:00
mpl 017d57d9d2 index,search: fix/finish wholeRef for fileInfo indexing
Bump index requiredSchemaVersion to 5.

Issue #581
Issue #577

Change-Id: I18e30aef280f97781132ef0841a189c7ca7e64be
2015-02-25 01:50:57 +01:00
Brad Fitzpatrick 8229c19850 search, index: add WholeRef to pkg camtypes' FileInfo struct
So when you describe a file, you also gets its wholeref.

TODO: we'll need to migrate old indexes to this new format on
start-up.

Change-Id: I4a3fb000d68bde46474275c2070ef285a6d6ecfc
2015-02-04 21:04:39 -08:00
mpl fda1399e9c index,camtool: try and cope better with broken exif
http://camlistore.org/issue/493

Change-Id: I40aebd67252cf82a3a5a143af6c258d7ed2aecda
2014-11-10 19:05:35 +01:00
Salmān Aljammāz 0d6e0c6425 index: avoid shadowing err when retrying to index a full file
Change-Id: Ie683739039116dfb2758c6647382afebaa6e1ece
2014-10-08 18:40:00 +01:00
mpl f15c5a7cd2 index/receive: address last comments from http://camlistore.org/r/3271
Change-Id: Id41278e5e01b9ea9310b392859709a3261dc3f52
2014-10-07 17:21:14 +02:00
Salmān Aljammāz e14c122c52 indexer: images: try a FileReader if the prefix is too small for DecodeConfig
Go's image.DecodeConfig needs more than 1MiB on some images (e.g. some
Lens Blur pics taken with Google Camera). Now we first try a 512KiB header
and retry with a full FileReader if that fails.

https://camlistore.org/bugs/477

Change-Id: I286d15d86a69951737d94dd3692d4e9e1992b324
2014-10-07 12:13:33 +00:00
Fabian Wickborn 59a451c2dc Merge upstream goexif
This pulls the changes from the current HEAD of
https://github.com/rwcarlsen/goexif
(eb2943811adc24a1a40d6dc0525995d4f8563d08)

Notable changes:
- Removed explicit panics in favor of error returns
- renamed TypeCategory to Format and made format calculated upon
  decoding rather than repeatedly for every format call
- Merged contributions from Camlistore (exif.LatLong(), exif.DateTime()
  etc.)
- Change String method to just return the string value - and don't have
  square brackets if only a single value
- add separate Int and Int64 retrieval methods
- Doc updates

Minor changes in camlistore.org/pkg/* were neccessary to reflect
changes in the API (handling of returned errors) and in names of
exported fields and methods.

Change-Id: I50412b5e68d2c9ca766ff2ad1a4ac26926baccab
2014-09-17 10:40:38 +02:00
Fabian Wickborn 2aed1b8241 Renamed goexif folder to match upstream URL
In the advent of github.com/camlistore/goexif to be closed, this
commit renames the goexif folder in third_party to match the
upstream on GitHub.

The affected import paths have been rewritten accordingly.

Change-Id: I5a8871efd01987944b7f5e93979307857ae16fe7
2014-09-05 17:27:59 +02:00
Fabian Wickborn f0d9c04bc2 Merge goexif with upstream package
This pulls the changes from the current HEAD of
https://github.com/rwcarlsen/goexif
(rev cf045e9d6ba052fd348f82394d364cca4937589a)

Changes to goexif from upstream:
- Add support for reading Nikon and Canon maker notes
- Adds parser registration to exif package
- Renamed cmd to exifstat
- Renamed exported fields and methods in goexif/tiff
- adds support for bare tiff images. bug fix and minor cosmetics
- support pulling the thumbnail
- adds thumbnail support to exif pkg
- tiff defines DataType and constants for the datatype values
- Update covnertVals and TypeCategory to use new constants for DataType
- Renamed test data dir in exif tests
- created type+constants for raw tiff tag data types

Not merged from upstream:
- ~1 MB of test JPGs in goexif/exif/samples

Minor changes in camlistore.org/pkg/* were neccessary to reflect the
name changes in the exported fields and methods.

Change-Id: I0fdcad2d7b5e01e0d4160a5eb52b8ec750d353cf
2014-09-05 08:36:42 +02:00
mpl f1953edb88 Merge "index: actually reindex when out of order" 2014-08-14 20:00:00 +00:00
mpl 0628249db1 index: actually reindex when out of order
problem: the out-of-order mechanism based on the outOfOrderIndexerLoop
was not working for some claims.

Let C be a delete claim on permanode P. If C was received before P was,
C was marked as being received with the "have" index row. However, for
the deletion to be marked in the index, some information about P is
needed (its meta row), so C could not be fully indexed upon reception.
Then, when P was finally received, the outOfOrderIndexerLoop would kick
in and retry indexing C. Which would fail, because a test based on the
"have" row would (wrongly) detect that C is already indexed and return
early.

In this patch:

-we introduce the "|indexed" suffix to the "have" - value part - row
(receive.go). If a blob is received but some of its dependencies are
missing, the have row value is written without the suffix. Upon
reception of a blob, we now test for the presence of the suffix in the
have row. If missing, the reception continues instead of returning
early. The existing mechanism that was detecting missing dependencies
for file blobs has been adapted to work with this suffix too.

-the index enumeration (enumstat.go), which relies on "have" rows, has
been adapted to work with the new "have" row format, while staying
compatible with the old format. And related tests have been added.

http://camlistore.org/issue/454

Change-Id: I2559d08a12b2a4e0f0691fc7e31f1ed1f874625e
2014-08-14 17:03:26 +02:00
Brad Fitzpatrick 4188fefaa0 sqlite: Empty file to make the go tool happy with a test-only directory.
Not sure if this is still needed but had it sitting on my filesystem, never
checked in.

Change-Id: I06a5efd265032b6a4f867a8d0504cfb4f061304b
2014-08-02 16:51:47 -07:00
Brad Fitzpatrick 31c324c206 corpus: respect more attributes when looking up permanode's time
Change-Id: I2ed9f9f100109510c1617e465a8d3e2b3261d244
2014-07-31 14:24:03 -07:00
Brad Fitzpatrick de629e036c search: allow searching by file wholeref 2014-07-29 14:38:20 -07:00
Brad Fitzpatrick 286b53f119 index: use Exif.LatLong accessor
This code is now moved to the exif package.

Change-Id: Ifba2e0b6a96c076e75179528e8ea9a4c0641d843
2014-07-13 10:25:04 -07:00
Brad Fitzpatrick 995a4ccb0e indextest: force timezone when testing receive
Otherwise JPEGs with EXIF can be interpretted differently.

Change-Id: Ia3fe64a92d7a8f0642363d758f2d1f402f1e4a1f
2014-07-13 10:04:03 -07:00
Bill Thiede eb7f66fe28 jpeg: enable images/jpeg imported from Go tip.
Addresses https://camlistore.org/issue/463

Change-Id: Ie7b8f937ded78d95875f4cd13b024d0429136981
2014-07-02 21:22:15 -07:00
mpl 443f405962 index: fix data race on BlobSource, make it private.
index.New was starting outOfOrderIndexerLoop in a goroutine. And
outOfOrderIndexerLoop had an if index.BlobSource == nil check, on which
it relied to go on. However, since BlobSource was public and unguarded,
the following sequence was possible:

ix, _ := index.New()
ix.BlobSource = bs

which is racy because the BlobSource assignment may or may not happen
before the check within outOfOrderIndexerLoop.

TestOutOfOrderIndexing was relying on the fact that apparently most
of the time the assignment seems to be happening before the check.

This patch:
-makes BlobSource (now blobSource) private, rendering the race impossible
out of the index package.
-moves the initialization of blobSource, as well as the execution of
outOfOrderIndexerLoop at a unique point, in InitBlobSource (new method).
-makes sure all accesses to blobSource are guarded with the index mutex
(now a RWMutex).

Context: while working on tests for http://camlistore.org/issue/454

Change-Id: I9605f26b41abd62b42880be0620b06ce143761bc
2014-06-27 22:29:29 +02:00
Brad Fitzpatrick 0c656e5361 Merge "index/corpus: cache sorted (by time) permanodes" 2014-06-24 00:39:47 +00:00
mpl 94f598ddb9 index/corpus: cache sorted (by time) permanodes
Context: http://camlistore.org/issue/298

Change-Id: I599f430e0f7691e54df38e10344c62cbdb6429a0
2014-06-24 02:39:25 +02:00
Brad Fitzpatrick 2ed6de8573 Import tweet GPS coordinates. Allow geo searching of them.
Change-Id: I5ed7848b2b5bae4ed05c934c0fc117f03453e6dd
2014-06-14 14:37:41 -07:00
Brad Fitzpatrick 27a28775d5 corpus: sort tweets by their startDate too
Change-Id: Ice2a7206a372b8777d5b0d0ffd701823b56f4828
2014-06-13 15:47:30 -07:00
Eric Drechsel 8f835e102c fix indent for index doc block
also consistent notation for k -> v mapping within the block

Change-Id: I0e18890ec8871057d303d23581ca7e93ff227ef8
2014-06-09 11:08:35 -07:00
Brad Fitzpatrick da86ded96a Merge "index: Index MusicBrainz album IDs from music files." 2014-05-14 00:02:06 +00:00
mpl 2088ce739b search: sort by creation time
Change-Id: I3695d91dde0d42419c62a23f20ba19416c53e5ef
2014-05-08 18:55:53 +02:00
Daniel Erat aa391ecdd1 index: Index MusicBrainz album IDs from music files.
Index "MusicBrainz Album ID" ID3v2 frames as
"musicbrainzalbumid" media tags to facilitate downloading
cover art from coverartarchive.org.

Change-Id: Ie81017dd6f76ec355ee0d1daedfb7180cb70ad59
2014-05-05 20:45:58 -07:00
Brad Fitzpatrick 8ac8437e91 index: add temporary hack for foursquare.com checkin times
Change-Id: Ia90097998ccb702b14c4634bb42be1e6387d61e8
2014-04-23 11:32:57 -07:00
Brad Fitzpatrick bf9f69bcfe search: allow searching by permanode location, not just file location.
Allows searching foursquare checkins by location.

Change-Id: Ib33d0b435a9bbc17cb860549b41d119f727197f0
2014-04-23 11:13:41 -07:00
Daniel Erat 82429eeedb index,search: Return media tags for describe requests.
Change-Id: Ie983465554e1dc9f5475753a074e48b363f25013
2014-04-15 21:11:33 -07:00
mpl a9db189cd7 docker tests: remove container when done
http://camlistore.org/issue/421

Change-Id: Iefde3a8235db0103e8fcfac51f5dfcce5df73ef6
2014-04-09 23:26:14 +02:00
mpl 899acb8e72 pkg/sorted: remove API for each distinct implementation
Change-Id: I42446683189cdb00dcfbec1f221885092fdd83d6
2014-04-08 01:37:08 +02:00
Brad Fitzpatrick bf32345778 index: make Postgres test use the JSON constructor.
Would caught camlistore.org/issue/418

Change-Id: Ic323607df355e664d3b76709a7ad56dc40637fcf
2014-04-06 14:29:07 -07:00
Brad Fitzpatrick bf2764cdfe index: rename the reindex method to indexBlob, to be less confusing.
Also, upon server --reindex, check that no out-of-order blobs are
pending.  From a quick reading, they shouldn't be, but I'm curious to
see.  Will do a full reindex of my data later.

Change-Id: Idebf93cc264e55512afcfb99e47320dd0ae745d1
2014-04-06 14:03:38 -07:00
mpl 0cc8f6122d Merge "pkg/index: cleanup, refactor sub pkgs" 2014-04-05 12:45:22 +00:00
mpl 291320d451 pkg/index: cleanup, refactor sub pkgs
http://camlistore.org/issue/263

Change-Id: I319bb097f0ce30b2bd5271b5c3bbff92b8dcc318
2014-04-05 01:22:05 +02:00
Brad Fitzpatrick bf2f09cab3 index: reschedule indexing a claim blob if public key blob isn't yet available
Change-Id: Ie0174bf830eb4790080b2b5e7cdc4ea0af25406f
2014-04-02 13:39:36 -07:00
mpl b0c4f85ee0 sorted/postgres: test with docker
Also, NewKeyValue now automatically creates the required tables.

http://camlistore.org/issue/263

Change-Id: I02dd7660ee08c2eaeec17131622d6f581fdd6c55
2014-03-28 19:34:09 +01:00
mpl 08f9c821f5 sorted,dockertest: added MySQL (dockerified) test
Two important related changes:

1) sorted/mysql now takes into account the host given in the config
2) the required tables are now automatically created by NewKeyValue

http://camlistore.org/issue/263

Change-Id: I0043f36edb0630d6484148508d3a1e08c8e88a94
2014-03-26 00:39:38 +01:00
mpl 9cadbcd5bc publish: use generic queries
Use generic queries instead of specialized index queries. This is a step
towards the publisher app, because its client will have to use generic
queries.

Context: http://camlistore.org/issue/365

Change-Id: I2781a345e024174e3bea8511b6cdc6f342d5a7c1
2014-03-18 17:26:29 +01:00
Brad Fitzpatrick bfc607fee7 index: reindex blobs when dependent blobs arrive out-of-order
Keep track of missing dependencies both in memory and in the index's
underlying sorted.KeyValue. When we see a dependent blob arrive, see
if we can reindex things.

Fixes camlistore.org/issue/102

Change-Id: I3d8cfc463e4b8c9d158be8f9656e772839b093b9
2014-03-15 08:44:09 -07: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
Brad Fitzpatrick bf01b14961 index: move seekFetcherMissTracker up a layer
In prep for missing blob dependency rescheduling in indexer.

Change-Id: I1d492e6aa64cfb658daec17e4621d1453c6d3607
2014-03-14 09:14:46 -07:00
Brad Fitzpatrick bfeb745882 corpus: add PermanodeHasAttrValueLocked convenience accessor
Change-Id: Ie73270ce54c3125a76987daa9f50895c5acf42db
2014-03-13 18:48:00 -07:00
Brad Fitzpatrick bf6ae30368 corpus: reverse-index claims with values that look like blobrefs
Allows efficiently finding parents of permanodes, or permanodes of
file contents, etc.

Adds Corpus.ForeachClaimBackLocked.

Change-Id: I6dffb32eab4a959cd3c5922a7f47d11fdcea5f3d
2014-03-13 18:47:25 -07:00
Brad Fitzpatrick d13bb4aaed Merge "corpus: deleted check when enumerating permanodes" 2014-03-10 17:56:53 +00:00
mpl 0fdca769e0 corpus: deleted check when enumerating permanodes
http://camlistore.org/issue/354

Change-Id: I7d76c654eb3b875ad8017a14a08a5c909bd696a0
2014-03-10 18:43:57 +01: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