Skip to content

Commit b619230

Browse files
Update Core to 2.27. (#495)
* Regenerate bindings for 2.27. * Deprecate filestore APIs. * Use `tiledb_group_dump_str_v2`. * Bump Core to 2.27.0. * Run nightlies on `release-2.27`. * Bump version to 2.17.0. * Add APIs to get enumerations from an array schema.
1 parent bdedd7b commit b619230

File tree

11 files changed

+636
-486
lines changed

11 files changed

+636
-486
lines changed

.github/workflows/nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- os: windows-latest
2828
platform: windows-x86_64
2929
- tag: dev
30-
tag: [release-2.26, dev]
30+
tag: [release-2.27, dev]
3131
runs-on: ${{ matrix.os }}
3232
steps:
3333
- name: Checkout TileDB
@@ -71,7 +71,7 @@ jobs:
7171
strategy:
7272
fail-fast: false
7373
matrix:
74-
tag: [release-2.26, dev]
74+
tag: [release-2.27, dev]
7575
runs-on: ubuntu-latest
7676
steps:
7777
- name: Checkout TileDB-CSharp
@@ -108,7 +108,7 @@ jobs:
108108
fail-fast: false
109109
matrix:
110110
os: [ubuntu-latest, macos-latest, windows-latest]
111-
tag: [release-2.26, dev]
111+
tag: [release-2.27, dev]
112112
runs-on: ${{ matrix.os }}
113113
steps:
114114
- name: Checkout TileDB-CSharp

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<TileDBNativePackageName>TileDB.Native</TileDBNativePackageName>
55
<TileDBNativeVersionMajor>2</TileDBNativeVersionMajor>
6-
<TileDBNativeVersionMinor>26</TileDBNativeVersionMinor>
6+
<TileDBNativeVersionMinor>27</TileDBNativeVersionMinor>
77
<TileDBNativePackageVersion>[$(TileDBNativeVersionMajor).$(TileDBNativeVersionMinor).0,$(TileDBNativeVersionMajor).$([MSBuild]::Add($(TileDBNativeVersionMinor), 1)).0)</TileDBNativePackageVersion>
88

99
<!-- The DevelopmentBuild property switches to the locally built native packages.

docs/obsoletions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Following [the deprecation policy of TileDB Embedded][core-deprecation], obsolet
1010
|[`TILEDB0012`](#TILEDB0012)[`TILEDB0013`](#TILEDB0013)|5.7.0|5.9.0|
1111
|[`TILEDB0014`](#TILEDB0014)[`TILEDB0014`](#TILEDB0014)|5.8.0|5.10.0|
1212
|[`TILEDB0015`](#TILEDB0015)[`TILEDB0015`](#TILEDB0015)|5.13.0|5.15.0|
13+
|[`TILEDB0015`](#TILEDB0016)[`TILEDB0015`](#TILEDB0016)|5.17.0|5.19.0|
1314

1415
## `TILEDB0001` - Enum value names that start with `TILEDB_` were replaced with C#-friendly names.
1516

@@ -363,4 +364,18 @@ The `ConfigIterator` class is unintuitive to use. In version 5.13.0 it was marke
363364

364365
Replace uses of `ConfigIterator` with enumerating the `Config` object directly using a `foreach` loop or LINQ. To get only the config options that start with a specific prefix, call the `Config.EnumerateOptions` method and enumerate its returned object.
365366

367+
## `TILEDB0016` - `File` is obsolete.
368+
369+
<a name="TILEDB0016"></a>
370+
371+
The TileDB filestore APIs, exposed by the `TileDB.CSharp.File` class are obsolete and will be removed in a future version.
372+
373+
### Version introduced
374+
375+
5.17.0
376+
377+
### Recommended action
378+
379+
There is no direct replacement. You can manually store files in TileDB by representing them as one-dimensional dense arrays of bytes.
380+
366381
[core-deprecation]: https://github.com/TileDB-Inc/TileDB/blob/dev/doc/policy/api_changes.md

scripts/generate-bindings/GenerateBindings.proj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
<ConfigOption Include="latest-codegen" />
1717
<ConfigOption Include="unix-types" />
1818
<ConfigOption Include="multi-file" />
19-
<Define Include="TILEDB_REMOVE_DEPRECATIONS" />
19+
<!-- <Define Include="TILEDB_REMOVE_DEPRECATIONS" /> -->
2020
<InputFile Include="tiledb/tiledb_experimental.h" />
2121
<TraversePaths Include="$(InputDir)/**/*.h" />
22+
<RemapHandleType Include="array" />
23+
<RemapHandleType Include="array_schema" />
2224
<RemapHandleType Include="attribute" />
2325
<RemapHandleType Include="buffer_list" />
2426
<RemapHandleType Include="buffer" />
@@ -34,10 +36,12 @@
3436
<RemapHandleType Include="error" />
3537
<RemapHandleType Include="filter_list" />
3638
<RemapHandleType Include="filter" />
39+
<RemapHandleType Include="fragment_info" />
3740
<RemapHandleType Include="group" />
3841
<RemapHandleType Include="query_channel" />
3942
<RemapHandleType Include="query_field" />
4043
<RemapHandleType Include="string" />
44+
<RemapHandleType Include="subarray" />
4145
<RemapHandleType Include="vfs_fh" />
4246
<RemapHandleType Include="vfs" />
4347
<Remap Include="@(RemapHandleType->'tiledb_%(Identity)_handle_t=tiledb_%(Identity)_t')" />

sources/TileDB.CSharp/ArraySchema.cs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,73 @@ public Domain Domain()
374374
return new Domain(_ctx, handle);
375375
}
376376

377+
/// <summary>
378+
/// Gets the <see cref="Enumeration"/> of the <see cref="ArraySchema"/> with the given name.
379+
/// </summary>
380+
/// <param name="name">The name of the enumeration.</param>
381+
public Enumeration GetEnumeration(string name)
382+
{
383+
var handle = new EnumerationHandle();
384+
var successful = false;
385+
tiledb_enumeration_t* enumeration_p = null;
386+
try
387+
{
388+
using (var ctxHandle = _ctx.Handle.Acquire())
389+
using (var schemaHandle = _handle.Acquire())
390+
using (var ms_name = new MarshaledString(name))
391+
{
392+
_ctx.handle_error(Methods.tiledb_array_schema_get_enumeration_from_name(ctxHandle, schemaHandle, ms_name, &enumeration_p));
393+
}
394+
successful = true;
395+
}
396+
finally
397+
{
398+
if (successful)
399+
{
400+
handle.InitHandle(enumeration_p);
401+
}
402+
else
403+
{
404+
handle.SetHandleAsInvalid();
405+
}
406+
}
407+
return new Enumeration(_ctx, handle);
408+
}
409+
410+
/// <summary>
411+
/// Gets the <see cref="Enumeration"/> attached to the <see cref="CSharp.Attribute"/>
412+
/// of the <see cref="ArraySchema"/> with the given name.
413+
/// </summary>
414+
/// <param name="name">The name of the attribute.</param>
415+
public Enumeration GetEnumerationOfAttribute(string name)
416+
{
417+
var handle = new EnumerationHandle();
418+
var successful = false;
419+
tiledb_enumeration_t* enumeration_p = null;
420+
try
421+
{
422+
using (var ctxHandle = _ctx.Handle.Acquire())
423+
using (var schemaHandle = _handle.Acquire())
424+
using (var ms_name = new MarshaledString(name))
425+
{
426+
_ctx.handle_error(Methods.tiledb_array_schema_get_enumeration_from_attribute_name(ctxHandle, schemaHandle, ms_name, &enumeration_p));
427+
}
428+
successful = true;
429+
}
430+
finally
431+
{
432+
if (successful)
433+
{
434+
handle.InitHandle(enumeration_p);
435+
}
436+
else
437+
{
438+
handle.SetHandleAsInvalid();
439+
}
440+
}
441+
return new Enumeration(_ctx, handle);
442+
}
443+
377444
/// <summary>
378445
/// Gets the <see cref="ArraySchema"/>'s tile order.
379446
/// </summary>

sources/TileDB.CSharp/File.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using System;
12
using System.ComponentModel;
23
using TileDB.CSharp.Marshalling.SafeHandles;
34
using TileDB.Interop;
45
using ArraySchemaHandle = TileDB.CSharp.Marshalling.SafeHandles.ArraySchemaHandle;
56

67
namespace TileDB.CSharp;
78

9+
[Obsolete(Obsoletions.FilestoreApiMessage, DiagnosticId = Obsoletions.ConfigIteratorDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
810
public sealed unsafe class File
911
{
1012
private readonly Context _ctx;

sources/TileDB.CSharp/Group.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,11 @@ public string Dump(bool recursive)
375375
{
376376
using var ctxHandle = _ctx.Handle.Acquire();
377377
using var handle = _handle.Acquire();
378-
sbyte* result;
378+
using var result = new StringHandleHolder();
379379
byte int_recursive = (byte)(recursive ? 1 : 0);
380-
_ctx.handle_error(Methods.tiledb_group_dump_str(ctxHandle, handle, &result, int_recursive));
380+
_ctx.handle_error(Methods.tiledb_group_dump_str_v2(ctxHandle, handle, &result._handle, int_recursive));
381381

382-
return MarshaledStringOut.GetStringFromNullTerminated(result);
382+
return result.ToString();
383383
}
384384
#endregion
385385
}

0 commit comments

Comments
 (0)