Code Monkey home page Code Monkey logo

cassandra-connection-pool's People

Contributors

tristantarrant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cassandra-connection-pool's Issues

Parent project not found in pom

I changed some stuff in the pom as it was not finding the parent project. I also added the riptano repository for cassandra and thrift dependencies (feel free to use this, we are committed to maintaining it). The additional changes in the pom are probably defined in the missing parent, but got the pom file working.
The diff follows...

diff --git a/pom.xml b/pom.xml
index d973465..e9899d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,9 +1,4 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-   <parent>
-       <groupId>net.dataforte</groupId>
-       <artifactId>dataforte-parent</artifactId>
-       <version>3</version>
-   </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>net.dataforte.cassandra</groupId>
@@ -32,19 +27,25 @@
    </distributionManagement>

    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.8.1</version>
+            <scope>test</scope>
+        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
-           <groupId>org.apache.thrift</groupId>
+           <groupId>libthrift</groupId>
            <artifactId>libthrift</artifactId>
            <version>917130</version>
        </dependency>
        <dependency>
-           <groupId>org.apache</groupId>
-           <artifactId>cassandra</artifactId>
+           <groupId>org.apache.cassandra</groupId>
+           <artifactId>apache-cassandra</artifactId>
            <version>0.6.5</version>
        </dependency>
        <dependency>
@@ -98,6 +99,20 @@
    </scm>

    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <optimize>true</optimize>
+                    <debug>true</debug>
+                    <showDeprecation>true</showDeprecation>
+                    <showWarnings>true</showWarnings>
+                </configuration>
+            </plugin>
+        </plugins>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
@@ -105,4 +120,11 @@
            </testResource>
        </testResources>
    </build>
+    <repositories>
+        <repository>
+            <id>riptano</id>
+            <name>riptano</name>
+            <url>http://mvn.riptano.com/content/repositories/public/</url>
+        </repository>
+    </repositories>
 </project>

Incorrect synchronization of ConnectionPool.connectionMap

Access to field connectionMap (which is not thread-safe) in class ConnectionPool is not synchronized properly. The problem is in method createConnection where new connections are created and put into the map however more threads can access the map at once - the locking mechanism on the connection does not protect the map. We encountered the problem in production resulting in infinite loop (caused by corrupted internal state of the map).

I suggest to replace HashMap with ConcurrentHashMap.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.