C# Class FoundationDB.Layers.Directories.FdbDirectoryLayer

Inheritance: IFdbDirectory
Mostrar archivo Open project: BedeGaming/foundationdb-dotnet-client Class Usage Examples

Private Properties

Property Type Description
ChangeLayerInternalAsync System.Threading.Tasks.Task
CheckReadVersionAsync System.Threading.Tasks.Task
CheckVersion void
CheckWriteVersionAsync System.Threading.Tasks.Task
ContentsOfNode FdbDirectorySubspace
Create FdbDirectoryLayer
Create FdbDirectoryLayer
Create FdbDirectoryLayer
Create FdbDirectoryLayer
CreateOrOpenInternalAsync Task
ExistsInternalAsync Task
FdbDirectoryLayer FoundationDB.Client
FindAsync Task
GetPartitionForNode FdbDirectoryPartition
GetSubDirKey Slice
IFdbDirectory Task
IFdbDirectory void
InitializeDirectory void
IsPrefixFree Task
ListInternalAsync Task>
MoveInternalAsync Task
NodeContainingKey Task
NodeWithPrefix FdbSubspace
ParsePath IFdbTuple
ParsePath IFdbTuple
PartitionSubPath IFdbTuple
RemoveFromParent Task
RemoveInternalAsync Task
RemoveRecursive System.Threading.Tasks.Task
SetLayer void
SubdirNamesAndNodes FdbSubspace>>.IFdbAsyncEnumerable
ToAbsolutePath IReadOnlyList
ToRelativePath IFdbTuple
VerifyPath IFdbTuple

Public Methods

Method Description
ChangeLayerAsync ( [ trans, [ path, Slice newLayer ) : Task

Change the layer id of the directory at

Combine ( IEnumerable parent ) : string[]
Combine ( IEnumerable parent, IEnumerable paths ) : string[]
Combine ( IEnumerable parent, string path ) : string[]
CreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task

Creates a directory with the given path (creating parent directories if necessary). An exception is thrown if the given directory already exists.

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

Opens the directory with the given path. If the directory does not exist, it is created (creating parent directories if necessary).

ExistsAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task

Checks if a directory already exists

FormatPath ( IEnumerable paths ) : string
ListAsync ( IFdbReadOnlyTransaction trans ) : Task>

Returns the list of subdirectories of the root directory

ListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>

Returns the list of subdirectories of directory at path

MoveAsync ( IFdbTransaction trans, IEnumerable oldPath, IEnumerable newPath ) : Task

Moves the directory found at oldPath 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 the old directory does not exist, a directory already exists at `new_path`, or the parent directory of `new_path` does not exist.

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

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

Parse ( string path ) : string[]
ParsePath ( IFdbTuple path ) : string[]

Convert a tuple representing a path, into a string array

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, IEnumerable path ) : 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.

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

Attempts to create a directory with the given path (creating parent directories if necessary).

TryListAsync ( IFdbReadOnlyTransaction trans ) : Task>
TryListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>

Returns the list of subdirectories of directory at path, if it exists.

TryMoveAsync ( IFdbTransaction trans, IEnumerable oldPath, IEnumerable newPath ) : Task

Attempts to move the directory found at oldPath to newPath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open. Returns null if the old directory does not exist, a directory already exists at `new_path`, or the parent directory of `new_path` does not exist.

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

Attempts to open the directory with the given path.

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

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

TryRemoveAsync ( IFdbTransaction trans, IEnumerable path ) : 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.

Private Methods

Method Description
ChangeLayerInternalAsync ( [ trans, [ path, Slice newLayer ) : System.Threading.Tasks.Task
CheckReadVersionAsync ( [ trans ) : System.Threading.Tasks.Task
CheckVersion ( Slice value, bool writeAccess ) : void
CheckWriteVersionAsync ( [ trans ) : System.Threading.Tasks.Task
ContentsOfNode ( FdbSubspace node, IFdbTuple relativePath, Slice layer ) : FdbDirectorySubspace

Returns a new Directory Subspace given its node subspace, path and layer id

Create ( ) : FdbDirectoryLayer
Create ( FdbSubspace nodeSubspace, FdbSubspace contentSubspace, IEnumerable path = null ) : FdbDirectoryLayer
Create ( FdbSubspace subspace, IEnumerable path = null ) : FdbDirectoryLayer
Create ( Slice prefix, IEnumerable path = null ) : FdbDirectoryLayer
CreateOrOpenInternalAsync ( IFdbReadOnlyTransaction readTrans, IFdbTransaction trans, [ path, Slice layer, Slice prefix, bool allowCreate, bool allowOpen, bool throwOnError ) : Task
ExistsInternalAsync ( [ trans, [ path ) : Task
FdbDirectoryLayer ( FdbSubspace nodeSubspace, FdbSubspace contentSubspace, IFdbTuple location ) : FoundationDB.Client

Creates a new instance that will manages directories in FoudnationDB.

FindAsync ( IFdbReadOnlyTransaction tr, IFdbTuple path ) : Task

Finds a node subspace, given its path, by walking the tree from the root.

GetPartitionForNode ( Node node ) : FdbDirectoryPartition
GetSubDirKey ( FdbSubspace parent, string path ) : Slice
IFdbDirectory ( IFdbTransaction trans, Slice newLayer ) : Task
IFdbDirectory ( Slice layer ) : void
InitializeDirectory ( IFdbTransaction trans ) : void
IsPrefixFree ( IFdbReadOnlyTransaction tr, Slice prefix ) : Task
ListInternalAsync ( [ trans, [ path, bool throwIfMissing ) : Task>
MoveInternalAsync ( [ trans, [ oldPath, [ newPath, bool throwOnError ) : Task
NodeContainingKey ( IFdbReadOnlyTransaction tr, Slice key ) : Task
NodeWithPrefix ( Slice prefix ) : FdbSubspace

Returns the subspace to a node metadata, given its prefix

ParsePath ( IEnumerable path, string argName = null ) : IFdbTuple
ParsePath ( [ name, string argName = null ) : IFdbTuple
PartitionSubPath ( IFdbTuple path = null ) : IFdbTuple

Convert a relative path in this Directory Layer, into an absolute path from the root of partition of the database

RemoveFromParent ( IFdbTransaction tr, IFdbTuple path ) : Task

Remove an existing node from its parents

RemoveInternalAsync ( [ trans, [ path, bool throwIfMissing ) : Task
RemoveRecursive ( IFdbTransaction tr, FdbSubspace node ) : System.Threading.Tasks.Task

Resursively remove a node (including the content), all its children

SetLayer ( [ trans, [ subspace, Slice layer ) : void
SubdirNamesAndNodes ( IFdbReadOnlyTransaction tr, FdbSubspace node ) : FdbSubspace>>.IFdbAsyncEnumerable

Returns the list of names and nodes of all children of the specified node

ToAbsolutePath ( [ path ) : IReadOnlyList
ToRelativePath ( [ path ) : IFdbTuple
VerifyPath ( [ path, string argName = null ) : IFdbTuple

Method Details

ChangeLayerAsync() public method

Change the layer id of the directory at
public ChangeLayerAsync ( [ trans, [ path, Slice newLayer ) : Task
trans [ Transaction to use for the operation
path [ Path of the directory to change
newLayer Slice New layer id of the directory
return Task

Combine() public static method

public static Combine ( IEnumerable parent ) : string[]
parent IEnumerable
return string[]

Combine() public static method

public static Combine ( IEnumerable parent, IEnumerable paths ) : string[]
parent IEnumerable
paths IEnumerable
return string[]

Combine() public static method

public static Combine ( IEnumerable parent, string path ) : string[]
parent IEnumerable
path string
return string[]

CreateAsync() public method

Creates a directory with the given path (creating parent directories if necessary). An exception is thrown if the given directory already exists.
public CreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : 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.
return Task

CreateOrOpenAsync() public method

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

ExistsAsync() public method

Checks if a directory already exists
public ExistsAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Path of the directory to remove (including any subdirectories)
return Task

FormatPath() public static method

public static FormatPath ( IEnumerable paths ) : string
paths IEnumerable
return string

ListAsync() public method

Returns the list of subdirectories of the root directory
public ListAsync ( IFdbReadOnlyTransaction trans ) : Task>
trans IFdbReadOnlyTransaction Transaction to use for the operation
return Task>

ListAsync() public method

Returns the list of subdirectories of directory at path
public ListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Path of the directory to list
return Task>

MoveAsync() public method

Moves the directory found at oldPath 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 the old directory does not exist, a directory already exists at `new_path`, or the parent directory of `new_path` does not exist.
public MoveAsync ( IFdbTransaction trans, IEnumerable oldPath, IEnumerable newPath ) : Task
trans IFdbTransaction Transaction to use for the operation
oldPath IEnumerable Path of the directory to move
newPath IEnumerable New path of the directory
return Task

MoveToAsync() public method

public MoveToAsync ( IFdbTransaction trans, IEnumerable newAbsolutePath ) : Task
trans IFdbTransaction
newAbsolutePath IEnumerable
return Task

OpenAsync() public method

Opens the directory with the given path. An exception is thrown if the directory does not exist, or if a layer is specified and a different layer was specified when the directory was created.
public OpenAsync ( IFdbReadOnlyTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Path of the directory to open.
layer Slice Optional layer id of the directory. If it is different than the layer specified when creating the directory, an exception will be thrown.
return Task

Parse() public static method

public static Parse ( string path ) : string[]
path string
return string[]

ParsePath() public static method

Convert a tuple representing a path, into a string array
public static ParsePath ( IFdbTuple path ) : string[]
path IFdbTuple Tuple that should only contain strings
return string[]

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, IEnumerable path ) : System.Threading.Tasks.Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Path of the directory to remove (including any subdirectories)
return System.Threading.Tasks.Task

ToString() public method

public ToString ( ) : string
return string

TryCreateAsync() public method

Attempts to create a directory with the given path (creating parent directories if necessary).
public TryCreateAsync ( IFdbTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : 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.
return Task

TryListAsync() public method

public TryListAsync ( IFdbReadOnlyTransaction trans ) : Task>
trans IFdbReadOnlyTransaction
return Task>

TryListAsync() public method

Returns the list of subdirectories of directory at path, if it exists.
public TryListAsync ( IFdbReadOnlyTransaction trans, IEnumerable path ) : Task>
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Path of the directory to list
return Task>

TryMoveAsync() public method

Attempts to move the directory found at oldPath to newPath. There is no effect on the physical prefix of the given directory, or on clients that already have the directory open. Returns null if the old directory does not exist, a directory already exists at `new_path`, or the parent directory of `new_path` does not exist.
public TryMoveAsync ( IFdbTransaction trans, IEnumerable oldPath, IEnumerable newPath ) : Task
trans IFdbTransaction Transaction to use for the operation
oldPath IEnumerable Path of the directory to move
newPath IEnumerable New path of the directory
return Task

TryMoveToAsync() public method

public TryMoveToAsync ( IFdbTransaction trans, IEnumerable newAbsolutePath ) : Task
trans IFdbTransaction
newAbsolutePath IEnumerable
return Task

TryOpenAsync() public method

Attempts to open the directory with the given path.
public TryOpenAsync ( IFdbReadOnlyTransaction trans, IEnumerable path, Slice layer = default(Slice) ) : Task
trans IFdbReadOnlyTransaction Transaction to use for the operation
path IEnumerable Path of the directory to open.
layer Slice Optional layer id of the directory. If it is different than the layer specified when creating the directory, an exception will be thrown.
return Task

TryRegisterAsync() public method

Attempts to register 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 TryRegisterAsync ( 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

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, IEnumerable path ) : Task
trans IFdbTransaction Transaction to use for the operation
path IEnumerable Path of the directory to remove (including any subdirectories)
return Task