A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pchalamet/cassandra-sharp below:

pchalamet/cassandra-sharp: high performance .NET driver for Apache Cassandra

I've stopped working on this driver. For better support, please gear towards the official .net Cassandra driver.

cassandra-sharp - high performance .NET driver for Apache Cassandra

The philosophy of cassandra-sharp is to be really simple and fast: no Linq provider, no complex API. Just CQL, simple object mapping and great performance :)

With version 4, cassandra-sharp is only speaking native protocol 4 - basically, this means you are required to use Cassandra 3.

cassandra-sharp supports async operations exposed as Rx subscriptions or TPL tasks. Efficient memory usage can be achieve using the push model of Rx.

A command line tool is also available (cqlplus) to access a Cassandra cluster. It's also a great tool to understand what's happening under the cover.

Binaries are available through NuGet : http://www.nuget.org/packages/cassandra-sharp

cassandra-sharp - high performance .NET driver for Apache Cassandra
Copyright (c) 2011-2017 Pierre Chalamet

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

To build cassandra-sharp, load cassandra-sharp.sln in Visual Studio 2017. To build from command line and to regenerate thrift proxy, use Build.cmd.

<configSections>
	<section name="CassandraSharp" type="CassandraSharp.SectionHandler, CassandraSharp.Interfaces" />
</configSections>

<CassandraSharp>
	<Cluster name="TestCassandra">
		<Endpoints>
			<Server>localhost</Server>
		</Endpoints>
	</Cluster>
</CassandraSharp>
public class SchemaKeyspaces
{
    public string KeyspaceName { get; set; }
    public bool DurableWrites { get; set; }
    public Dictionary<string, string> Replication { get; set; }
}
	
public static class Sample
{
    private static void DisplayKeyspace(SchemaKeyspaces ks)
    {
        Console.WriteLine("KeyspaceName={0} DurableWrites={1} Class={2} ReplicationFactor={3}",
                          ks.KeyspaceName,
                          ks.DurableWrites,
                          ks.Replication["class"],
                          ks.Replication["replication_factor"]);
    }
	
    public static async Task QueryKeyspaces()
    {
        XmlConfigurator.Configure();
        using (ICluster cluster = ClusterManager.GetCluster("TestCassandra"))
        {
            var cmd = cluster.CreatePocoCommand();
            const string cqlKeyspaces = "SELECT * from system_schema.keyspaces";

            // async operation with streaming
            cmd.WithConsistencyLevel(ConsistencyLevel.ONE)
               .Execute<SchemaKeyspaces>(cqlKeyspaces)
               .Subscribe(DisplayKeyspace);

            // future
            var kss = await cmd.Execute<SchemaKeyspaces>(cqlKeyspaces).AsFuture();
            foreach (var ks in kss)
                DisplayKeyspace(ks);
        }

        ClusterManager.Shutdown();
    }
}

JetBrains provided a free licence of Resharper for the cassandra-sharp project. Big thanks for the awesome product.

This projects also relies on the following third parties:

Thanks to all contributors for ideas, bug fix and feedbacks!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4