Return-Path: X-Original-To: apmail-cassandra-dev-archive@www.apache.org Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A40310827 for ; Tue, 9 Jul 2013 18:06:24 +0000 (UTC) Received: (qmail 67191 invoked by uid 500); 9 Jul 2013 18:06:23 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 66915 invoked by uid 500); 9 Jul 2013 18:06:23 -0000 Mailing-List: contact dev-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list dev@cassandra.apache.org Received: (qmail 66904 invoked by uid 99); 9 Jul 2013 18:06:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jul 2013 18:06:22 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [209.85.214.52] (HELO mail-bk0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jul 2013 18:06:17 +0000 Received: by mail-bk0-f52.google.com with SMTP id d7so2456843bkh.39 for ; Tue, 09 Jul 2013 11:05:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=XUG/BLtcvWofs0ShQr3UNglNOX49rayRqMpfeFjWrto=; b=DceedFKA0cV+xaxN3Ck3SNziUaQpJCmLG/7AcSCePS3n8E4Rbz5QFUndMO0M1Dk/q2 WyScvfkOhWIA0Z8HgKtMjQp53irIOqF1rIwoFRU8iX3BkhTs7m/ydT8BpEyt1LNDJjga d6UXyNmGTkm+f8Koz08Lui5L2iEKY+6W9FwGHUU5Qb/921uvZvPh8VC+sNms1EnDSEnm Gn87Yz3qNhPWpclXAKKo5c+7sga0poawNld4jTqcjjCtckxkTqxnS3yJvDKsLV+WB97F JgNyJQKc6Hy8yIEYp4uEVfphcSvL49C+LFqJIZXuE0Ma3bG3O9+c1x25850oSD7vkfHd wYFA== X-Received: by 10.204.170.66 with SMTP id c2mr4349294bkz.101.1373393136134; Tue, 09 Jul 2013 11:05:36 -0700 (PDT) Received: from [192.168.1.115] (87-206-117-99.dynamic.chello.pl. [87.206.117.99]) by mx.google.com with ESMTPSA id kz11sm6148125bkb.11.2013.07.09.11.05.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Jul 2013 11:05:35 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-2 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Configuration of network connectors From: =?iso-8859-2?Q?=A3ukasz_Dywicki?= In-Reply-To: <52D19973-F8B1-40DE-9A5C-5E3E96729D27@gmail.com> Date: Tue, 9 Jul 2013 20:05:32 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <270CD5F0-0585-4117-8AE3-C02A34F15069@code-house.org> References: <52D19973-F8B1-40DE-9A5C-5E3E96729D27@gmail.com> To: dev@cassandra.apache.org X-Mailer: Apple Mail (2.1508) X-Gm-Message-State: ALoCoQl6scTmXUWSjuYk07tkfK6MvvRbe4ikpNo2jjfXc6RfUF/hCiWbRq2sbhPHZ5Gl6lFHOITe X-Virus-Checked: Checked by ClamAV on apache.org Jeremy, Sadly it does not cover our case. We have unit tests and we want to test = really basic things like mappings of data contained in cassandra to our = model. For that we don't need cluster at all because in unit tests we = don't want to test data distribution. We also would like to run = everything in JVM, thus CCM written in Python is not really what we = need. What we are looking for is minimal cassandra set up which could be = embedded and used concurrently multiple times. For example we now use = CassandraUnit: @Rule public CassandraUnit unit =3D new CassandraUnit(new EmptyDataSet(), = "embedded-cassandra.yaml"); @Test public void fistTest() { // do something with data } @Test public void secondTest() { // do something else } In this set up JUnit will launch new CassandraDaemon for every test. If = we set FORK_MODE per test then we may have two cassandra instances = running at the same time. First test which launch CassandraDaemon will = pass, second may fail due port usage conflict. That's why we thought = about testing without network layer. This can save some time. It would = be great because for some older hardware used by our developers it takes = up to 9 minutes to run build with all unit tests. Some of this time is = consumed by startup and shutdown of cassandra. Cheers, =A3ukasz Dywicki -- luke@code-house.org Twitter: ldywicki Blog: http://dywicki.pl Code-House - http://code-house.org Wiadomo=B6=E6 napisana przez Jeremy Hanna w = dniu 9 lip 2013, o godz. 15:22: > Have you seen https://github.com/pcmanus/ccm as described in = http://www.datastax.com/dev/blog/ccm-a-development-tool-for-creating-local= -cassandra-clusters or does that not fit your use case? >=20 > On 9 Jul 2013, at 14:02, =A3ukasz Dywicki wrote: >=20 >> Hello, >> First of all I would like to say hello to cassandra user and = developer community. :) >>=20 >> I write because we are using Cassandra in our unit tests and we have = some troubles with network connectivity. We ca not run multiple = cassandra instances during tests because we would need to randomize = configuration of port and so on. For now if we try to fork our tests we = get "address already in use" on one from two ports - native or thrift. = In other apache projects we can "VM" connectors (ActiveMQ, Camel, Mina) = based on in-memory queue. I took some time to see how CassandraDaemon = starts servers and it's kinda of hardcoded. I thought about changing = configuration to be more like: >>=20 >> servers: >> - class org.apache.cassandra.thrift.ThriftServer >> - class org.apache.cassandra.transport.Server >>=20 >> Then we will be able to disable these servers for unit tests: >> servers: >> - class org.apache.cassandra.vm.VmServer >>=20 >> This requires some small changes in daemon code and client libraries. = I'm not really deeply involved in cassandra stuff so I don't know the = internal architecture and implications thus I look forward for you to = discuss this topic. >>=20 >> Cheers, >> =A3ukasz Dywicki >> -- >> luke@code-house.org >> Twitter: ldywicki >> Blog: http://dywicki.pl >> Code-House - http://code-house.org >>=20 >=20