Skip to content

Commit

Permalink
update to longtail 0.4.2-pre5 (#251)
Browse files Browse the repository at this point in the history
- **FIXED** Networks share paths that starts with \\ no longer need to be manually escaped (fixes #249)
- **UPDATED** Update longtaillib to v0.4.2
  • Loading branch information
DanEngelbrecht authored Mar 10, 2024
1 parent 3b418bc commit f8a9c55
Show file tree
Hide file tree
Showing 21 changed files with 187 additions and 58 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
go-version: 1.21

- name: Check out source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build
run: |
Expand All @@ -61,7 +61,7 @@ jobs:
cp ${{matrix.target}} dist/
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist-${{matrix.platform}}-${{matrix.arch}}
path: dist
Expand All @@ -74,28 +74,28 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download Linux artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: dist-linux-amd64
path: dist-linux-x64

- name: Download MacOs x64 artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: dist-macos-amd64
path: dist-macos-x64

- name: Download MacOs arm64 artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: dist-macos-arm64
path: dist-macos-arm64

- name: Download Win32 artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: dist-win32-amd64
path: dist-win32-x64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
go-version: 1.21

- name: Check out source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: test
if: ${{ matrix.arch == 'amd64' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

Expand All @@ -34,7 +34,7 @@ jobs:
go-version: 1.21

- name: Check out source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: test
if: ${{ matrix.arch == 'amd64' }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
##
- **FIXED** Networks share paths that starts with \\ no longer need to be manually escaped (fixes https://github.com/DanEngelbrecht/golongtail/issues/249)
- **UPDATED** Update longtaillib to v0.4.2

## v0.4.1
- **UPDATED** Update to golang 1.21
- **UPDATED** Update longtaillib to v0.4.1
- **UPDATED** Updated all golang dependencies
Expand Down
8 changes: 5 additions & 3 deletions commands/cmd_clonestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func updateCurrentVersionFromLongtail(
}
} else {
targetFolderScanner := longtailutils.AsyncFolderScanner{}
targetFolderScanner.Scan(targetPath, pathFilter, fs)
targetFolderScanner.Scan(targetPath, pathFilter, fs, jobs)

targetIndexReader := longtailutils.AsyncVersionIndexReader{}
targetIndexReader.Read(targetPath,
Expand Down Expand Up @@ -299,7 +299,9 @@ func updateCurrentVersionFromLongtail(
longtailstorelib.NormalizeFileSystemPath(targetPath),
retainPermissions)
} else {
concurrentChunkWriteAPI := longtaillib.CreateConcurrentChunkWriteAPI(fs, longtailstorelib.NormalizeFileSystemPath(targetPath))
concurrentChunkWriteAPI := longtaillib.CreateConcurrentChunkWriteAPI(fs, sourceVersionIndex,
versionDiff,
longtailstorelib.NormalizeFileSystemPath(targetPath))
defer concurrentChunkWriteAPI.Dispose()
err = longtaillib.ChangeVersion2(
sourceStore,
Expand All @@ -326,7 +328,7 @@ func updateCurrentVersionFromLongtail(
return longtaillib.Longtail_VersionIndex{}, hash, errors.Wrap(err, fname)
}
targetFolderScanner := longtailutils.AsyncFolderScanner{}
targetFolderScanner.Scan(targetPath, pathFilter, fs)
targetFolderScanner.Scan(targetPath, pathFilter, fs, jobs)

targetIndexReader := longtailutils.AsyncVersionIndexReader{}
targetIndexReader.Read(targetPath,
Expand Down
4 changes: 2 additions & 2 deletions commands/cmd_downsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func downsync(

targetFolderScanner := longtailutils.AsyncFolderScanner{}
if scanTarget && targetIndexPath == "" {
targetFolderScanner.Scan(resolvedTargetFolderPath, pathFilter, fs)
targetFolderScanner.Scan(resolvedTargetFolderPath, pathFilter, fs, jobs)
}

hashRegistry := longtaillib.CreateFullHashRegistry()
Expand Down Expand Up @@ -267,7 +267,7 @@ func downsync(
changeVersionStartTime := time.Now()
changeVersionProgress := longtailutils.CreateProgress("Updating version ", 1)
defer changeVersionProgress.Dispose()
concurrentChunkWriteAPI := longtaillib.CreateConcurrentChunkWriteAPI(fs, longtailstorelib.NormalizeFileSystemPath(resolvedTargetFolderPath))
concurrentChunkWriteAPI := longtaillib.CreateConcurrentChunkWriteAPI(fs, sourceVersionIndex, versionDiff, longtailstorelib.NormalizeFileSystemPath(resolvedTargetFolderPath))
defer concurrentChunkWriteAPI.Dispose()

if useLegacyWrite {
Expand Down
10 changes: 5 additions & 5 deletions commands/cmd_pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ func pack(
fs := longtaillib.CreateFSStorageAPI()
defer fs.Dispose()

sourceFolderScanner := longtailutils.AsyncFolderScanner{}
if sourceIndexPath == "" {
sourceFolderScanner.Scan(sourceFolderPath, pathFilter, fs)
}

jobs := longtaillib.CreateBikeshedJobAPI(uint32(numWorkerCount), 0)
defer jobs.Dispose()
hashRegistry := longtaillib.CreateFullHashRegistry()
defer hashRegistry.Dispose()

sourceFolderScanner := longtailutils.AsyncFolderScanner{}
if sourceIndexPath == "" {
sourceFolderScanner.Scan(sourceFolderPath, pathFilter, fs, jobs)
}

compressionType, err := longtailutils.GetCompressionType(compressionAlgorithm)
if err != nil {
return storeStats, timeStats, errors.Wrapf(err, fname)
Expand Down
4 changes: 2 additions & 2 deletions commands/cmd_unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func unpack(

targetFolderScanner := longtailutils.AsyncFolderScanner{}
if scanTarget && targetIndexPath == "" {
targetFolderScanner.Scan(resolvedTargetFolderPath, pathFilter, fs)
targetFolderScanner.Scan(resolvedTargetFolderPath, pathFilter, fs, jobs)
}

hashRegistry := longtaillib.CreateFullHashRegistry()
Expand Down Expand Up @@ -217,7 +217,7 @@ func unpack(
longtailstorelib.NormalizeFileSystemPath(resolvedTargetFolderPath),
retainPermissions)
} else {
concurrentChunkWriteAPI := longtaillib.CreateConcurrentChunkWriteAPI(fs, longtailstorelib.NormalizeFileSystemPath(resolvedTargetFolderPath))
concurrentChunkWriteAPI := longtaillib.CreateConcurrentChunkWriteAPI(fs, sourceVersionIndex, versionDiff, longtailstorelib.NormalizeFileSystemPath(resolvedTargetFolderPath))
defer concurrentChunkWriteAPI.Dispose()

err = longtaillib.ChangeVersion2(
Expand Down
10 changes: 5 additions & 5 deletions commands/cmd_upsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ func upsync(
fs := longtaillib.CreateFSStorageAPI()
defer fs.Dispose()

sourceFolderScanner := longtailutils.AsyncFolderScanner{}
if sourceIndexPath == "" {
sourceFolderScanner.Scan(sourceFolderPath, pathFilter, fs)
}

jobs := longtaillib.CreateBikeshedJobAPI(uint32(numWorkerCount), 0)
defer jobs.Dispose()
hashRegistry := longtaillib.CreateFullHashRegistry()
defer hashRegistry.Dispose()

sourceFolderScanner := longtailutils.AsyncFolderScanner{}
if sourceIndexPath == "" {
sourceFolderScanner.Scan(sourceFolderPath, pathFilter, fs, jobs)
}

compressionType, err := longtailutils.GetCompressionType(compressionAlgorithm)
if err != nil {
return storeStats, timeStats, errors.Wrapf(err, fname)
Expand Down
8 changes: 8 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4 changes: 2 additions & 2 deletions longtaillib/golongtail.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ static struct Longtail_VersionIndex* GetArchiveVersionIndex(struct Longtail_Arch

static void EnableMemtrace() {
Longtail_MemTracer_Init();
Longtail_SetAllocAndFree(Longtail_MemTracer_Alloc, Longtail_MemTracer_Free);
Longtail_SetReAllocAndFree(Longtail_MemTracer_ReAlloc, Longtail_MemTracer_Free);
}

static void DisableMemtrace() {
Longtail_SetAllocAndFree(0, 0);
Longtail_SetReAllocAndFree(0, 0);
Longtail_MemTracer_Dispose();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
extern "C" {
#endif

LONGTAIL_EXPORT extern struct Longtail_ConcurrentChunkWriteAPI* Longtail_CreateConcurrentChunkWriteAPI(struct Longtail_StorageAPI* storageAPI, const char* base_path);
LONGTAIL_EXPORT extern struct Longtail_ConcurrentChunkWriteAPI* Longtail_CreateConcurrentChunkWriteAPI(
struct Longtail_StorageAPI* storageAPI,
struct Longtail_VersionIndex* version_index,
struct Longtail_VersionDiff* version_diff,
const char* base_path);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LONGTAIL_EXPORT extern uint32_t Longtail_GetMemTracerDetailed();
LONGTAIL_EXPORT void Longtail_MemTracer_Init();
LONGTAIL_EXPORT char* Longtail_MemTracer_GetStats(uint32_t log_level);
LONGTAIL_EXPORT void Longtail_MemTracer_Dispose();
LONGTAIL_EXPORT void* Longtail_MemTracer_Alloc(const char* context, size_t s);
LONGTAIL_EXPORT void* Longtail_MemTracer_ReAlloc(const char* context, void* old, size_t s);
LONGTAIL_EXPORT void Longtail_MemTracer_Free(void* p);

LONGTAIL_EXPORT int Longtail_MemTracer_DumpStats(const char* name);
Expand Down
Loading

0 comments on commit f8a9c55

Please sign in to comment.