StefanoB
1 Copper

new to centera (.net) sdk : what metadata set for clip and how to behave on resources release errors

Jump to solution

Hello

One of our customers has asked my firm to integrate one of our dotnet applications with its Centera server , so i'm developing a library to store and retrieve documents on it. I've read the programmer guide, the best practice guide and i've run the examples shipped with .net sdk . Yet there are a couple of things that aren't clear to me :

first of all , am i entitled to use the online servers for development purposes ?

the second question is how shall i handle exceptions during resources release ? when a close call raises an exception, shall i try to release the next resource or terminate the operation. For example if i get an exception on stream close, shall i try to close tag,clip, and pool or shall i forget about them (for example because that would raise another exception)?

Finally i have not clear how to identify a clip : suppose i set the clip name equal to the name of the file i want to store to the server:

clipRef = new FPClip(pool, fileName);

If i load multiple clips with the same name (and eventually referring the same file ), same tags with same metadata , will get an update of the first clip/content loaded or will be loaded more clip and contents ?

Since a requirement is that only one instace of the document must exist and can't be modified or delete before a certain date, i suppose for first case retention should prevent document updates/replacements. If it's true the second case (more clips with the same name) , how can i check if a clip with that name already exist or forbid creation of more clips with same name,content and metadata ?

thank you in advance for any help

regards

0 Kudos
1 Solution

Accepted Solutions
gstuartemc
2 Iron

Re: new to centera (.net) sdk : what metadata set for clip and how to behave on resources release errors

Jump to solution

Single Instance Storage is enabled when the cluster is set to Storage Strategy Capacity. It is also the default strategy used by the SDK to store content.

Collision Avoidance can be enabled via code or set up on the cluster by setting Storage Strategy Performance. When it is set on the cluster, it only forces this option for files under the threshold size that is configured. So if you want Collision Avoidance for all files it should be set via code.

If a cluster is set for Storage Strategy Performance you cannot "force" it to perform Single Instancing - the cluster automatically adds a GUID for files whose size is under than the the threshold (typically 250KB).

0 Kudos
3 Replies
gstuartemc
2 Iron

Re: new to centera (.net) sdk : what metadata set for clip and how to behave on resources release errors

Jump to solution

The online clusters are intended for development use. Just do not expect content you write to be persisted there for a long period as they do get scrubbed periodically. Also do not base any performance levels on the results you receive.

If you get errors closing resources (streams, tags. clips) then this will lead to you being unable to close the parent object. So you would be unable to close a clip if you have not closed all open tags.

In most cases, if the clip write was is successful then you can ignore the error and it will be cleared on shutting down your application.If operations fail then you should restart the operation from the beginning i.e. for writing a clip, create a new clip and tags and rewrite the blobs.

The clip "name" is purely part of the metadata - it does not identify the clip. When you create a clip (metadata, tags and blobs) you receive a Content Address back that identifies the clip. If you performed exactly the same operation again (with the same elements) you will get back a different Content Address as system metadata (timestamps etc) will have changed. However, the blob (data) objects that you stored will be single instanced (if applicable) i.e. multiple CDF objects will reference the same blob objects.

Any changes you make to an existing to clip will result in a new clip if you write it to the Centera - the original will still exist. You cannot prevent a clip being opened, changes made and then written again - but in this case, the original remains exactly the same and is "signed" by its Content Address. The new clip will have a different Content Address.

StefanoB
1 Copper

Re: new to centera (.net) sdk : what metadata set for clip and how to behave on resources release errors

Jump to solution

thank you very much for your answer, clear and simple.

I have a last doubt, i whish to be sure i've understood correctly differences between "single instance" and "collision avoidance" :

Single instance mean that blob will be shared among clips, if i load the same content mutliple times.  Collision avoidance means that , if i set the option to true, every time i load content on the server it will be stored with its clip, regardless if i've already loaded it inside another clip.

So having to store only once a document , i need single instance mode (that is default) . Theese options are set by system administrators or it's my code that opt for one or another mode?

0 Kudos
gstuartemc
2 Iron

Re: new to centera (.net) sdk : what metadata set for clip and how to behave on resources release errors

Jump to solution

Single Instance Storage is enabled when the cluster is set to Storage Strategy Capacity. It is also the default strategy used by the SDK to store content.

Collision Avoidance can be enabled via code or set up on the cluster by setting Storage Strategy Performance. When it is set on the cluster, it only forces this option for files under the threshold size that is configured. So if you want Collision Avoidance for all files it should be set via code.

If a cluster is set for Storage Strategy Performance you cannot "force" it to perform Single Instancing - the cluster automatically adds a GUID for files whose size is under than the the threshold (typically 250KB).

0 Kudos