Skip to content

Commit

Permalink
Update to longtail v0.2.6 (#183)
Browse files Browse the repository at this point in the history
* Update to longtail v0.2.6
* Be a bit more relaxed on consistency in remote_store test
  • Loading branch information
DanEngelbrecht authored Dec 3, 2021
1 parent a92cc9f commit 4bbd409
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ jobs:
body: |
Changes in this Release
- **ADDED** `version` command showing the current executable version
- **UPDATED** Updated longtail to v0.2.6
draft: false
prerelease: false
- name: Download Linux artifacts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "../../src/longtail.h"

#ifdef __cplusplus
extern "C" {
#endif

LONGTAIL_EXPORT extern struct Longtail_BlockStoreAPI* Longtail_CreateArchiveBlockStore(
struct Longtail_StorageAPI* storage_api,
const char* archive_path,
struct Longtail_ArchiveIndex* archive_index,
int enable_write);

#ifdef __cplusplus
}
#endif
20 changes: 20 additions & 0 deletions longtaillib/longtail/include/src/longtail.h
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,26 @@ struct Longtail_VersionIndex
char* m_NameData;
};

struct Longtail_ArchiveIndex
{
uint32_t* m_Version;
uint32_t* m_IndexDataSize;
struct Longtail_StoreIndex m_StoreIndex;
uint64_t* m_BlockStartOffets;
uint32_t* m_BlockSizes;
struct Longtail_VersionIndex m_VersionIndex;
};

LONGTAIL_EXPORT int Longtail_CreateArchiveIndex(
const struct Longtail_StoreIndex* store_index,
const struct Longtail_VersionIndex* version_index,
struct Longtail_ArchiveIndex** out_archive_index);

LONGTAIL_EXPORT int Longtail_ReadArchiveIndex(
struct Longtail_StorageAPI* storage_api,
const char* path,
struct Longtail_ArchiveIndex** out_archive_index);

LONGTAIL_EXPORT uint32_t Longtail_VersionIndex_GetVersion(const struct Longtail_VersionIndex* version_index);
LONGTAIL_EXPORT uint32_t Longtail_VersionIndex_GetHashAPI(const struct Longtail_VersionIndex* version_index);
LONGTAIL_EXPORT uint32_t Longtail_VersionIndex_GetAssetCount(const struct Longtail_VersionIndex* version_index);
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.
10 changes: 6 additions & 4 deletions remotestore/remotestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"runtime"
"sync"
"testing"
"time"

"github.com/DanEngelbrecht/golongtail/longtaillib"
"github.com/DanEngelbrecht/golongtail/longtailstorelib"
Expand Down Expand Up @@ -797,11 +798,12 @@ func testStoreIndexSync(blobStore longtailstorelib.BlobStore, t *testing.T) {
newStoreIndex.Dispose()
}

if !validateThatBlocksArePresent(generatedBlocksIndex, client) {
log.Printf("Could not find generated blocks in store index, retrying...\n")
if !validateThatBlocksArePresent(generatedBlocksIndex, client) {
t.Errorf("Could not find generated blocks in store index")
for i := 0; i < 5; i++ {
if validateThatBlocksArePresent(generatedBlocksIndex, client) {
break
}
log.Printf("Could not find generated blocks in store index, retrying...\n")
time.Sleep(1 * time.Second)
}

blockHashes := generatedBlocksIndex.GetBlockHashes()
Expand Down

0 comments on commit 4bbd409

Please sign in to comment.