Skip to content

Commit 9199bbe

Browse files
authored
Update to TileDB 2.11.2 (#98)
1 parent c7cc6b3 commit 9199bbe

File tree

13 files changed

+95
-51
lines changed

13 files changed

+95
-51
lines changed

.github/scripts/download_tiledb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set -e -x
2-
TAG=2.11.1
3-
ID=15a1161
2+
TAG=2.11.2
3+
ID=6ad6f76
44

55
RELEASE=x86_64-$TAG-$ID
66
wget https://github.com/TileDB-Inc/TileDB/releases/download/$TAG/tiledb-windows-$RELEASE.zip

cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# setup
66
cmake_minimum_required(VERSION 3.16)
77

8-
set(TILEDB_VERSION "2.11.1" CACHE STRING "TileDB version")
8+
set(TILEDB_VERSION "2.11.2" CACHE STRING "TileDB version")
99
set(TILEDB_GIT_TAG "dev" CACHE STRING "git branch")
1010

1111
project(TileDB-CSharp)

cpp/cmake/TileDB.cmake

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ message(STATUS "start to set tiledb for version:${TILEDB_VERSION}")
99
if(${TILEDB_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
1010
message(STATUS "start to set TILEDB_DOWNLOAD_URL and TILEDB_DOWNLOAD_SHA1")
1111

12-
if(${TILEDB_VERSION} STREQUAL "2.11.1")
12+
if(${TILEDB_VERSION} STREQUAL "2.11.2")
13+
if (WIN32) # Windows
14+
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-windows-x86_64-2.11.2-6ad6f76.zip")
15+
SET(TILEDB_DOWNLOAD_SHA1 "2a8a35782e73dce77c539c75db9a5736fc796ca8")
16+
elseif(APPLE) # OSX
17+
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-macos-x86_64-2.11.2-6ad6f76.tar.gz")
18+
SET(TILEDB_DOWNLOAD_SHA1 "55f4e4b478f44ce84abe467fe8ed3d7fffc7a1a0")
19+
else() # Linux
20+
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-linux-x86_64-2.11.2-6ad6f76.tar.gz")
21+
SET(TILEDB_DOWNLOAD_SHA1 "e6840cccd280b5c57695c359033d56df38fb3f1b")
22+
endif()
23+
elseif(${TILEDB_VERSION} STREQUAL "2.11.1")
1324
if (WIN32) # Windows
1425
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-windows-x86_64-2.11.1-15a1161.zip")
1526
SET(TILEDB_DOWNLOAD_SHA1 "f88420f4269aaac69a1dfb53e20f4848c407fa3f")
@@ -396,14 +407,14 @@ elseif(${TILEDB_VERSION} STREQUAL "2.0.7")
396407
endif()
397408
else()
398409
if (WIN32) # Windows
399-
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-windows-x86_64-2.11.1-15a1161.zip")
400-
SET(TILEDB_DOWNLOAD_SHA1 "f88420f4269aaac69a1dfb53e20f4848c407fa3f")
410+
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-windows-x86_64-2.11.2-6ad6f76.zip")
411+
SET(TILEDB_DOWNLOAD_SHA1 "2a8a35782e73dce77c539c75db9a5736fc796ca8")
401412
elseif(APPLE) # OSX
402-
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-macos-x86_64-2.11.1-15a1161.tar.gz")
403-
SET(TILEDB_DOWNLOAD_SHA1 "95439b79e6f27cd9441403429161b8fc962e03ea")
413+
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-macos-x86_64-2.11.2-6ad6f76.tar.gz")
414+
SET(TILEDB_DOWNLOAD_SHA1 "55f4e4b478f44ce84abe467fe8ed3d7fffc7a1a0")
404415
else() # Linux
405-
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.1/tiledb-linux-x86_64-2.11.1-15a1161.tar.gz")
406-
SET(TILEDB_DOWNLOAD_SHA1 "909a579420abcd490c54b486f10a1791499f30d8")
416+
SET(TILEDB_DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.11.2/tiledb-linux-x86_64-2.11.2-6ad6f76.tar.gz")
417+
SET(TILEDB_DOWNLOAD_SHA1 "e6840cccd280b5c57695c359033d56df38fb3f1b")
407418
endif()
408419
endif()
409420

examples/TileDB.CSharp.Example/ExampleFile.cs

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34

45
namespace TileDB.CSharp.Examples
56
{
67
public class ExampleFile
78
{
89
private Context _ctx;
910
private string _nameSpace;
10-
11+
1112
// Local access
1213
public ExampleFile()
1314
{
1415
_ctx = Context.GetDefault();
1516
_nameSpace = String.Empty;
1617
}
17-
18+
1819
// S3 access
1920
public ExampleFile(string key, string secret)
2021
{
@@ -24,7 +25,7 @@ public ExampleFile(string key, string secret)
2425
_ctx = new Context(config);
2526
_nameSpace = String.Empty;
2627
}
27-
28+
2829
// TileDB Cloud access with token
2930
public ExampleFile(string host, string token, string nameSpace)
3031
{
@@ -49,8 +50,21 @@ public ExampleFile(string host, string username, string password, string nameSpa
4950
public void SaveFileToArray(string pathOrBucket, string arrayName, string fileToSave)
5051
{
5152
var arrayURI = string.Join("/", new List<string>(new string[] {pathOrBucket, arrayName}));
53+
54+
// If no fileToSave exists, create one with some text data
55+
if (!System.IO.File.Exists(fileToSave))
56+
{
57+
System.IO.File.WriteAllText(fileToSave, "Some text data");
58+
}
59+
5260
if (_nameSpace == String.Empty)
5361
{
62+
// If exported array exists, recreate it
63+
if (Directory.Exists(arrayURI))
64+
{
65+
Directory.Delete(arrayURI, true);
66+
}
67+
5468
FileStoreUtil.SaveFileToArray(_ctx, arrayURI, fileToSave);
5569
return;
5670
}
@@ -80,24 +94,33 @@ public static void RunLocal()
8094
var localArrayName = "array_name";
8195
var localOutputFile = "local_out_file";
8296

97+
if (!Directory.Exists(localPath))
98+
{
99+
Directory.CreateDirectory(localPath);
100+
}
101+
83102
var exampleFile = new ExampleFile();
103+
// Import localFile to new TileDB Array
84104
exampleFile.SaveFileToArray(localPath, localArrayName, localFile);
105+
// Export TileDB Array to new localOutputFile
85106
exampleFile.ExportArrayToFile(localOutputFile, localArrayName, localPath);
86107
}
87108

88-
public static void RunCloud()
109+
public static void RunCloud(string token, string nameSpace, string cloudArrayName, string s3Bucket,
110+
string host = "https://api.tiledb.com")
89111
{
112+
// Local file to import to new TileDB Cloud Array
90113
var localFile = "local_file";
91-
var bucket = "bucket";
92-
var cloudArrayName = "cloud_array_name";
93-
var localOutputFileFromCloud = "local_out";
94-
95-
var exampleFile = new ExampleFile(
96-
"http://localhost:8181",
97-
"token",
98-
"userNameOrOrganization"
99-
);
100-
exampleFile.SaveFileToArray(bucket, cloudArrayName, localFile);
114+
// Local file to store exported TileDB Cloud Array
115+
var localOutputFileFromCloud = "local_out_cloud_file";
116+
117+
// Convert a local file to new TileDB Cloud Array
118+
// + Creates TileDB Array: tiledb://<nameSpace>/<cloudArrayName>
119+
// + Stored on S3: <s3bucket>/<cloudArrayName>
120+
var exampleFile = new ExampleFile(host, token, nameSpace);
121+
// Import localFile to new TileDB Cloud Array
122+
exampleFile.SaveFileToArray(s3Bucket, cloudArrayName, localFile);
123+
// Export TileDB Cloud Array to new local file
101124
exampleFile.ExportArrayToFile(localOutputFileFromCloud, cloudArrayName);
102125
}
103126
}

examples/TileDB.CSharp.Example/ExampleGroup.cs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34

45
namespace TileDB.CSharp.Examples
56
{
67
public class ExampleGroup
78
{
89
private Context _ctx;
910
private string _nameSpace;
10-
11+
1112
// Local access
1213
public ExampleGroup()
1314
{
1415
_ctx = Context.GetDefault();
1516
_nameSpace = String.Empty;
1617
}
17-
18+
1819
// S3 access
1920
public ExampleGroup(string key, string secret)
2021
{
@@ -24,7 +25,7 @@ public ExampleGroup(string key, string secret)
2425
_ctx = new Context(config);
2526
_nameSpace = String.Empty;
2627
}
27-
28+
2829
// TileDB Cloud access with token
2930
public ExampleGroup(string host, string token, string nameSpace)
3031
{
@@ -53,7 +54,16 @@ public void CreateGroups(string pathOrBucket, string groupName1, string groupNam
5354

5455
if (_nameSpace == String.Empty)
5556
{
57+
if (Directory.Exists(groupURI1))
58+
{
59+
Directory.Delete(groupURI1, true);
60+
}
5661
Group.Create(_ctx, groupURI1);
62+
63+
if (Directory.Exists(groupURI2))
64+
{
65+
Directory.Delete(groupURI2, true);
66+
}
5767
Group.Create(_ctx, groupURI2);
5868
return;
5969
}
@@ -87,7 +97,11 @@ public void NestGroup(string pathOrBucket, string parentGroupName, string childG
8797

8898
public static void RunLocal()
8999
{
90-
var localGroupPath = "localPath";
100+
var localGroupPath = "local_path";
101+
if (!Directory.Exists(localGroupPath))
102+
{
103+
Directory.CreateDirectory(localGroupPath);
104+
}
91105
var localGroupName1 = "group1";
92106
var localGroupName2 = "group2";
93107

@@ -96,17 +110,13 @@ public static void RunLocal()
96110
exampleGroup.NestGroup(localGroupPath, localGroupName1, localGroupName2);
97111
}
98112

99-
public static void RunCloud()
113+
public static void RunCloud(string token, string nameSpace, string s3BucketPrefix,
114+
string host = "https://api.tiledb.com")
100115
{
101-
var s3BucketPrefix = "s3://bucket/prefix";
102116
var cloudGroupName1 = "cloud_group1";
103117
var cloudGroupName2 = "cloud_group2";
104118

105-
var exampleGroup = new ExampleGroup(
106-
"http://localhost:8181",
107-
"token",
108-
""
109-
);
119+
var exampleGroup = new ExampleGroup(host, token, nameSpace);
110120
exampleGroup.CreateGroups(s3BucketPrefix, cloudGroupName1, cloudGroupName2);
111121
exampleGroup.NestGroup(s3BucketPrefix, cloudGroupName1, cloudGroupName2);
112122
}

examples/TileDB.CSharp.Example/Program.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ static void Main(string[] args)
1010
Console.WriteLine("TileDB Core Version: {0}", CoreUtil.GetCoreLibVersion());
1111

1212
ExampleQuery.Run();
13-
// ExampleIncompleteQuery.Run();
14-
// ExampleIncompleteQueryStringDimensions.Run();
13+
ExampleIncompleteQuery.Run();
14+
ExampleIncompleteQueryStringDimensions.Run();
1515

16-
//ExampleFile.RunLocal();
17-
//ExampleFile.RunCloud();
16+
ExampleFile.RunLocal();
17+
// ExampleFile.RunCloud("tiledb_api_token", "tiledb_namespace", "cloud_array_name", "s3://bucket/prefix/");
1818

19-
//ExampleGroup.RunLocal();
20-
//ExampleGroup.RunCloud();
19+
ExampleGroup.RunLocal();
20+
// ExampleGroup.RunCloud("tiledb_api_token", "tiledb_namespace", "s3://bucket/prefix");
2121
}
2222
}
2323
}

examples/TileDB.CSharp.Example/TileDB.CSharp.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<RollForward>Major</RollForward>
77
<RootNamespace>TileDB.CSharp.Examples</RootNamespace>
88
<TargetFramework>net5.0</TargetFramework>
9-
<Version>5.2.2</Version>
9+
<Version>5.2.3</Version>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

examples/bindings/quickstart_sparse_string/quickstart_sparse_string.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<OutputType>Exe</OutputType>
66
<RollForward>Major</RollForward>
77
<TargetFramework>net5.0</TargetFramework>
8-
<Version>5.2.2</Version>
8+
<Version>5.2.3</Version>
99
</PropertyGroup>
1010

1111
<ItemGroup>

scripts/generate/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ source ~/.zshrc
8181
Install specific version of TileDB in `/usr/local`
8282

8383
```bash
84-
git clone https://github.com/TileDB-Inc/TileDB.git -b 2.11.1
85-
mv TileDB TileDB_2.11.1
86-
cd TileDB_2.11.1
84+
git clone https://github.com/TileDB-Inc/TileDB.git -b 2.11.2
85+
mv TileDB TileDB_2.11.2
86+
cd TileDB_2.11.2
8787
mkdir build && cd build
8888
#cmake 3.22.2
8989
cmake -DTILEDB_VERBOSE=OFF -DTILEDB_S3=ON -DTILEDB_SERIALIZATION=ON -DTILEDB_AZURE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ..

sources/TileDB.CSharp/FileStoreUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace TileDB.CSharp
88
{
9-
public class FileStoreUtil
9+
public static class FileStoreUtil
1010
{
1111
public static void SaveFileToArray(Context ctx, string array_uri, string file)
1212
{

0 commit comments

Comments
 (0)