NOTE: This method is now obsolete.


Restore tables previously checkpointed.


Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)

Syntax

Visual Basic (Declaration)
Public Function restore( _ 
   ByVal tblnames As String() _ 
) As String()
C#
public string[] restore(
   string[] tblnames
)
C++
public:
 array<String>^ restore(
   array<String>^ tblnames
) sealed 
J#
public string[] restore(
   string[] tblnames
)
JScript
public  function restore(
   tblnames : String[]
) : String[]

Parameters

tblnames
The names of the tables to be restored. Pass null to restore all tables that were previously checkpointed.

Return Value

An array of the names of the tables that were successfully restored.

Exceptions

Exception TypeCondition
NetricsExceptionIf the server indicates that an error has occured (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, PARTIALRESTORE, RESTOREFAILED, INTERNAL, NOSYSINIT, SHUTDOWN)

Remarks

This restores a table to the state of the latest checkpoint for that table. The checkpoint could have been made from this invocation of the server, in which case this backs up the state of the table to that at the time of the last checkpoint, or in a previous invocation of the server, in which case this is a way to quickly reload a table.

In order to restore a file the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

If some, but not all, of the tables fail to restore a NetricsException is thrown with error code PARTIALRESTORE.

If all tables fail to restore correctly a NetricsException is thrown with error code RESTOREFAILED.

Example

This sample code shows how to restore the "names" table from a previous checkpoint.

 Copy Code
                        using System;
                        using NetricsServerInterface;
                        class MyClass
                        {
                            private static NetricsServerInterface.NetricsServerInterface si = null;
                            public static void Main()
                            {
                                try
                                {
                                    String host = "localhost";
                                    int port = 5051;
                                    si = new NetricsServerInterface.NetricsServerInterface(host, port);
                                    String[] tableList = { "names" };
                                    si.restore(tableList);
                                    Console.Write("Table restored.\n");
                                }
                                catch (NetricsException e)
                                {
                                    Console.Write(e.getErrorDescription() + "\n");
                                }
                            }
                        }
                    

See Also