C# Class FoundationDB.Layers.Directories.FdbDirectorySubspace

Inheritance: FdbSubspace, IFdbDirectory
Datei anzeigen Open project: BedeGaming/foundationdb-dotnet-client Class Usage Examples

Public Methods

Method Description
ChangeLayerAsync ( IFdbTransaction trans, Slice newLayer ) : Task

Change the layer id of this directory

CheckLayer ( Slice layer ) : void

Ensure that this directory was registered with the correct layer id

CreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task

Creates a subdirectory with the given path (creating intermediate subdirectories if necessary). An exception is thrown if the given subdirectory already exists.

CreateOrOpenAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task

Opens a subdirectory with the given path. If the subdirectory does not exist, it is created (creating intermediate subdirectories if necessary).

DumpKey ( Slice key ) : string
ExistsAsync ( IFdbReadOnlyTransaction trans ) : Task

Checks if this directory exists

ExistsAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task

Checks if a sub-directory exists

ListAsync ( IFdbReadOnlyTransaction trans ) : Task>

Returns the list of all the subdirectories of the current directory.

ListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>

Returns the list of all the subdirectories of a sub-directory.

MoveToAsync ( IFdbTransaction trans, IEnumerable newAbsolutePath ) : Task

Moves the current directory to newAbsolutePath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open. An error is raised if a directory already exists at `new_path`, or if the new path points to a child of the current directory.

OpenAsync ( IFdbReadOnlyTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task

Opens a subdirectory with the given path. An exception is thrown if the subdirectory does not exist, or if a layer is specified and a different layer was specified when the subdirectory was created.

RegisterAsync ( IFdbTransaction trans, IEnumerable path, Slice layer, Slice prefix ) : Task

Registers an existing prefix as a directory with the given path (creating parent directories if necessary). This method is only indented for advanced use cases.

RemoveAsync ( IFdbTransaction trans ) : System.Threading.Tasks.Task

Removes the directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.

RemoveAsync ( IFdbTransaction trans, IEnumerable path ) : System.Threading.Tasks.Task

Removes a sub-directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.

ToString ( ) : string

Returns a user-friendly description of this directory

TryCreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task

Creates a subdirectory with the given path (creating intermediate subdirectories if necessary). An exception is thrown if the given subdirectory already exists.

TryListAsync ( IFdbReadOnlyTransaction trans ) : Task>

Returns the list of all the subdirectories of a sub-directory, it it exists.

TryListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>

Returns the list of all the subdirectories of the current directory, it it exists.

TryMoveToAsync ( IFdbTransaction trans, IEnumerable newPath ) : Task

Attempts to move the current directory to newPath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open.

TryOpenAsync ( IFdbReadOnlyTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task

Opens a subdirectory with the given path. An exception is thrown if the subdirectory if a layer is specified and a different layer was specified when the subdirectory was created.

TryRemoveAsync ( IFdbTransaction trans ) : Task

Attempts to remove the directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.

TryRemoveAsync ( IFdbTransaction trans, IEnumerable path ) : Task

Attempts to remove a sub-directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.

Protected Methods

Method Description
GetLayerForPath ( IFdbTuple relativeLocation ) : FdbDirectoryLayer

Return the DirectoryLayer instance that should be called for the given path

ToRelativePath ( IEnumerable path ) : IFdbTuple

Convert a path relative to this directory, into a path relative to the root of the current partition

ToRelativePath ( IFdbTuple location ) : IFdbTuple

Convert a path relative to this directory, into a path relative to the root of the current partition

Private Methods

Method Description
FdbDirectorySubspace ( IFdbTuple location, IFdbTuple relativeLocation, Slice prefix, FdbDirectoryLayer directoryLayer, Slice layer ) : FoundationDB.Client
IFdbDirectory ( IFdbTransaction trans, IEnumerable oldPath, IEnumerable newPath ) : Task

Moves the specified subdirectory to newPath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open. An error is raised if a directory already exists at `new_path`.

Method Details

ChangeLayerAsync() public method

Change the layer id of this directory
public ChangeLayerAsync ( IFdbTransaction trans, Slice newLayer ) : Task
trans IFdbTransaction Transaction to use for the operation
newLayer Slice New layer id of this directory
return Task

CheckLayer() public method

Ensure that this directory was registered with the correct layer id
If the directory was registerd with a different layer id
public CheckLayer ( Slice layer ) : void
layer Slice Expected layer id (if not empty)
return void

CreateAsync() public method

Creates a subdirectory with the given path (creating intermediate subdirectories if necessary). An exception is thrown if the given subdirectory already exists.
public CreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Relative path of the subdirectory to create
layer Slice If is specified, it is recorded with the subdirectory and will be checked by future calls to open.
return Task

CreateOrOpenAsync() public method

Opens a subdirectory with the given path. If the subdirectory does not exist, it is created (creating intermediate subdirectories if necessary).
public CreateOrOpenAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Relative path of the subdirectory to create or open
layer Slice If is specified, it is checked against the layer of an existing subdirectory or set as the layer of a new subdirectory.
return Task

DumpKey() public method

public DumpKey ( Slice key ) : string
key Slice
return string

ExistsAsync() public method

Checks if this directory exists
public ExistsAsync ( IFdbReadOnlyTransaction trans ) : Task
trans IFdbReadOnlyTransaction
return Task

ExistsAsync() public method

Checks if a sub-directory exists
public ExistsAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task
trans IFdbReadOnlyTransaction
path IEnumerable
return Task

GetLayerForPath() protected method

Return the DirectoryLayer instance that should be called for the given path
protected GetLayerForPath ( IFdbTuple relativeLocation ) : FdbDirectoryLayer
relativeLocation IFdbTuple Location relative to this directory subspace
return FdbDirectoryLayer

ListAsync() public method

Returns the list of all the subdirectories of the current directory.
public ListAsync ( IFdbReadOnlyTransaction trans ) : Task>
trans IFdbReadOnlyTransaction
return Task>

ListAsync() public method

Returns the list of all the subdirectories of a sub-directory.
public ListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>
trans IFdbReadOnlyTransaction
path IEnumerable
return Task>

MoveToAsync() public method

Moves the current directory to newAbsolutePath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open. An error is raised if a directory already exists at `new_path`, or if the new path points to a child of the current directory.
public MoveToAsync ( IFdbTransaction trans, IEnumerable newAbsolutePath ) : Task
trans IFdbTransaction Transaction to use for the operation
newAbsolutePath IEnumerable Full path (from the root) where this directory will be moved
return Task

OpenAsync() public method

Opens a subdirectory with the given path. An exception is thrown if the subdirectory does not exist, or if a layer is specified and a different layer was specified when the subdirectory was created.
public OpenAsync ( IFdbReadOnlyTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Relative path of the subdirectory to open
layer Slice If specified, the opened directory must have the same layer id.
return Task

RegisterAsync() public method

Registers an existing prefix as a directory with the given path (creating parent directories if necessary). This method is only indented for advanced use cases.
public RegisterAsync ( IFdbTransaction trans, IEnumerable path, Slice layer, Slice prefix ) : Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Path of the directory to create
layer Slice If is specified, it is recorded with the directory and will be checked by future calls to open.
prefix Slice The directory will be created with the given physical prefix; otherwise a prefix is allocated automatically.
return Task

RemoveAsync() public method

Removes the directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
public RemoveAsync ( IFdbTransaction trans ) : System.Threading.Tasks.Task
trans IFdbTransaction Transaction to use for the operation
return System.Threading.Tasks.Task

RemoveAsync() public method

Removes a sub-directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
public RemoveAsync ( IFdbTransaction trans, IEnumerable path ) : System.Threading.Tasks.Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Path of the sub-directory to remove (relative to this directory)
return System.Threading.Tasks.Task

ToRelativePath() protected method

Convert a path relative to this directory, into a path relative to the root of the current partition
protected ToRelativePath ( IEnumerable path ) : IFdbTuple
path IEnumerable Path relative from this directory
return IFdbTuple

ToRelativePath() protected method

Convert a path relative to this directory, into a path relative to the root of the current partition
protected ToRelativePath ( IFdbTuple location ) : IFdbTuple
location IFdbTuple Path relative from this directory
return IFdbTuple

ToString() public method

Returns a user-friendly description of this directory
public ToString ( ) : string
return string

TryCreateAsync() public method

Creates a subdirectory with the given path (creating intermediate subdirectories if necessary). An exception is thrown if the given subdirectory already exists.
public TryCreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Relative path of the subdirectory to create
layer Slice If is specified, it is recorded with the subdirectory and will be checked by future calls to open.
return Task

TryListAsync() public method

Returns the list of all the subdirectories of a sub-directory, it it exists.
public TryListAsync ( IFdbReadOnlyTransaction trans ) : Task>
trans IFdbReadOnlyTransaction
return Task>

TryListAsync() public method

Returns the list of all the subdirectories of the current directory, it it exists.
public TryListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>
trans IFdbReadOnlyTransaction
path IEnumerable
return Task>

TryMoveToAsync() public method

Attempts to move the current directory to newPath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open.
public TryMoveToAsync ( IFdbTransaction trans, IEnumerable newPath ) : Task
trans IFdbTransaction Transaction to use for the operation
newPath IEnumerable Full path (from the root) where this directory will be moved
return Task

TryOpenAsync() public method

Opens a subdirectory with the given path. An exception is thrown if the subdirectory if a layer is specified and a different layer was specified when the subdirectory was created.
public TryOpenAsync ( IFdbReadOnlyTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Relative path of the subdirectory to open
layer Slice If specified, the opened directory must have the same layer id.
return Task

TryRemoveAsync() public method

Attempts to remove the directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
public TryRemoveAsync ( IFdbTransaction trans ) : Task
trans IFdbTransaction Transaction to use for the operation
return Task

TryRemoveAsync() public method

Attempts to remove a sub-directory, its contents, and all subdirectories. Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
public TryRemoveAsync ( IFdbTransaction trans, IEnumerable path ) : Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Path of the sub-directory to remove (relative to this directory)
return Task