Skip to content

Commit

Permalink
change fs remote store extension (#205)
Browse files Browse the repository at this point in the history
* set block extension to ".lsb" for fsblockstore in remote stores

* update longtaillib to 0.3.3

* release notes and fix release name

* fix logntaillib test
  • Loading branch information
DanEngelbrecht authored May 20, 2022
1 parent 613df18 commit d6a408e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 17 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
name: Release ${{ github.ref }}
body: |
Changes in this Release
- **ADDED** `put` commmand to complement `get` commmand
- **CHANGED** `--get-config-path` option has been removed from `upsync`; use `put` instead.
- **CHANGED** `--get-config-path` option for `get` renamed to `--source-path`
- **FIXED** Automatic resolving of `--target-path` for `downsync` and `get` now resolves to a folder in the local directory
- **UPDATED** Updated longtail to 0.3.2
- **CHANGED** set block extension to ".lsb" for fsblockstore in remote stores
- **UPDATED** Updated longtail to 0.3.3
draft: false
prerelease: false
- name: Download Linux artifacts
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_clonestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ func cloneStore(
var sourceCompressBlockStore longtaillib.Longtail_BlockStoreAPI

if len(localCachePath) > 0 {
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), enableFileMapping)
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), "", enableFileMapping)

cacheBlockStore = longtaillib.CreateCacheBlockStore(jobs, localIndexStore, sourceRemoteIndexStore)

Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func cpVersionIndex(
if localCachePath == "" {
compressBlockStore = longtaillib.CreateCompressBlockStore(remoteIndexStore, creg)
} else {
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), enableFileMapping)
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), "", enableFileMapping)

cacheBlockStore = longtaillib.CreateCacheBlockStore(jobs, localIndexStore, remoteIndexStore)

Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_downsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func downsync(
if localCachePath == "" {
compressBlockStore = longtaillib.CreateCompressBlockStore(remoteIndexStore, creg)
} else {
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), enableFileMapping)
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), "", enableFileMapping)

cacheBlockStore = longtaillib.CreateCacheBlockStore(jobs, localIndexStore, remoteIndexStore)

Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func ls(
fakeBlockStoreFS := longtaillib.CreateInMemStorageAPI()
defer fakeBlockStoreFS.Dispose()

fakeBlockStore := longtaillib.CreateFSBlockStore(jobs, fakeBlockStoreFS, "store", false)
fakeBlockStore := longtaillib.CreateFSBlockStore(jobs, fakeBlockStoreFS, "store", "", false)
defer fakeBlockStoreFS.Dispose()

storeIndex, err := longtaillib.CreateStoreIndex(
Expand Down
2 changes: 1 addition & 1 deletion commands/cmd_printVersionUsage.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func printVersionUsage(
indexStore = remoteIndexStore
} else {
localFS = longtaillib.CreateFSStorageAPI()
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), false)
localIndexStore = longtaillib.CreateFSBlockStore(jobs, localFS, longtailutils.NormalizePath(localCachePath), "", false)

cacheBlockStore = longtaillib.CreateCacheBlockStore(jobs, localIndexStore, remoteIndexStore)

Expand Down
Binary file modified longtaillib/longtail/liblongtail_darwin_x64.a
Binary file not shown.
Binary file modified longtaillib/longtail/liblongtail_linux_x64.a
Binary file not shown.
Binary file modified longtaillib/longtail/liblongtail_win32_x64.a
Binary file not shown.
11 changes: 9 additions & 2 deletions longtaillib/longtaillib.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,14 +990,21 @@ func (asyncCompleteAPI *Longtail_AsyncFlushAPI) OnComplete(err error) {
}

// CreateFSBlockStore() ...
func CreateFSBlockStore(jobAPI Longtail_JobAPI, storageAPI Longtail_StorageAPI, contentPath string, enableFileMapping bool) Longtail_BlockStoreAPI {
func CreateFSBlockStore(jobAPI Longtail_JobAPI, storageAPI Longtail_StorageAPI, contentPath string, blockExtension string, enableFileMapping bool) Longtail_BlockStoreAPI {
cContentPath := C.CString(contentPath)
defer C.free(unsafe.Pointer(cContentPath))

var cBlockExtension *C.char
if blockExtension != "" {
cBlockExtension = C.CString(blockExtension)
defer C.free(unsafe.Pointer(cBlockExtension))
}

cFileMapping := C.int(0)
if enableFileMapping {
cFileMapping = C.int(1)
}
return Longtail_BlockStoreAPI{cBlockStoreAPI: C.Longtail_CreateFSBlockStoreAPI(jobAPI.cJobAPI, storageAPI.cStorageAPI, cContentPath, nil, cFileMapping)}
return Longtail_BlockStoreAPI{cBlockStoreAPI: C.Longtail_CreateFSBlockStoreAPI(jobAPI.cJobAPI, storageAPI.cStorageAPI, cContentPath, cBlockExtension, cFileMapping)}
}

// CreateCacheBlockStore() ...
Expand Down
4 changes: 2 additions & 2 deletions longtaillib/longtaillib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func TestFSBlockStore(t *testing.T) {
defer storageAPI.Dispose()
jobAPI := CreateBikeshedJobAPI(uint32(runtime.NumCPU()), 0)
defer jobAPI.Dispose()
blockStoreAPI := CreateFSBlockStore(jobAPI, storageAPI, "content", false)
blockStoreAPI := CreateFSBlockStore(jobAPI, storageAPI, "content", "", false)
defer blockStoreAPI.Dispose()
blake3 := CreateBlake3HashAPI()
defer blake3.Dispose()
Expand Down Expand Up @@ -1127,7 +1127,7 @@ func TestRewriteVersion(t *testing.T) {
t.Errorf("TestRewriteVersion() CreateStoreIndex() %s", err)
}
defer storeIndex.Dispose()
blockStorageAPI := CreateFSBlockStore(jobAPI, storageAPI, "block_store", false)
blockStorageAPI := CreateFSBlockStore(jobAPI, storageAPI, "block_store", "", false)
defer blockStorageAPI.Dispose()
compressionRegistry := CreateZStdCompressionRegistry()
compressionRegistry.Dispose()
Expand Down
4 changes: 2 additions & 2 deletions remotestore/remotestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,8 @@ func CreateBlockStoreForURI(
err := fmt.Errorf("azure Gen2 storage not yet implemented for path %s", uri)
return longtaillib.Longtail_BlockStoreAPI{}, errors.Wrap(err, fname)
case "file":
return longtaillib.CreateFSBlockStore(jobAPI, longtaillib.CreateFSStorageAPI(), blobStoreURL.Path[1:], enableFileMapping), nil
return longtaillib.CreateFSBlockStore(jobAPI, longtaillib.CreateFSStorageAPI(), blobStoreURL.Path[1:], ".lsb", enableFileMapping), nil
}
}
return longtaillib.CreateFSBlockStore(jobAPI, longtaillib.CreateFSStorageAPI(), uri, enableFileMapping), nil
return longtaillib.CreateFSBlockStore(jobAPI, longtaillib.CreateFSStorageAPI(), uri, ".lsb", enableFileMapping), nil
}

0 comments on commit d6a408e

Please sign in to comment.