Represents a Hypertable context, handles the connection to the storage provider instance.

Namespace: Hypertable
Assembly: ht4n (in ht4n.dll) Version: 0.9.8.11 (0.9.8.11)

Syntax

         
 C#  Visual Basic  Visual C++ 
public interface IContext : IDisposable
Public Interface IContext _
	Inherits IDisposable
public interface class IContext : IDisposable

Members

            
 All Members  Properties   Methods   Events  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
CreateClient()()()()
Creates a new Client instance.
Dispose()()()()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
HasFeature(ContextFeature)
Returns true if the actual provider supports the feature specified, otherwise false.
IsDisposed
Gets a value indicating whether the object has been disposed.
Properties
Gets the configuration properties.
SessionStateChanged
Occurs when the Hypertable session state changed.

Remarks

Default initialization of the Hypertable context uses the configuration (conf/hypertable.cfg) of the executing process if exist.

Examples

The following example shows how to create a Hypertable context.
CopyC#
using( var ctx = Context.Create("Provider=Hyper; Uri=localhost") ) {
   using( var client = ctx.CreateClient() ) {
      // use client
   }
}
The following example shows how to create a Hypertable context using configuration properties.
CopyC#
IDictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("Hypertable.Logging.Level", "info");
using( var ctx = Context.Create("Provider=Hyper; Uri=localhost", properties) ) {
   using( var client = ctx.CreateClient() ) {
      // use client
   }
}
The following example shows how to create a Hypertable context using an external configuration file.
CopyC#
using( var ctx = Context.Create("Provider=Hyper; Uri=localhost; config=TestConfiguration.cfg") ) {
   using( var client = ctx.CreateClient() ) {
      // use client
   }
}
The following example shows how to access the configuration properties.
CopyC#
using( var ctx = Context.Create("Provider=Thrift; Uri=localhost") ) {
   int thriftBrokerTimeout = (int)ctx.Properties["ThriftBroker.Timeout"];
}

See Also