From a9648438433ef2bc42d6c91ef5eda6f722e3a68c Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 30 Jan 2013 09:30:59 +0100 Subject: [PATCH] =?UTF-8?q?move=20akka-io=20project=20into=20akka-actor?= =?UTF-8?q?=E2=80=99s=20akka.io=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scala/akka/io/CapacityLimitSpec.scala | 0 .../test/scala/akka/io/IntegrationSpec.scala | 0 .../akka/io/IntegrationSpecSupport.scala | 0 .../scala/akka/io/TcpConnectionSpec.scala | 0 .../test/scala/akka/io/TcpListenerSpec.scala | 0 .../src/test/scala/akka/io/TestUtils.scala | 0 akka-actor/src/main/resources/reference.conf | 84 +++++++++++++++++ .../scala/akka/io/DirectByteBufferPool.scala | 0 .../src/main/scala/akka/io/IO.scala | 0 .../src/main/scala/akka/io/Tcp.scala | 0 .../main/scala/akka/io/TcpConnection.scala | 0 .../scala/akka/io/TcpIncomingConnection.scala | 0 .../src/main/scala/akka/io/TcpListener.scala | 0 .../src/main/scala/akka/io/TcpManager.scala | 0 .../scala/akka/io/TcpOutgoingConnection.scala | 0 .../src/main/scala/akka/io/TcpSelector.scala | 0 akka-io/src/main/resources/reference.conf | 90 ------------------- project/AkkaBuild.scala | 13 +-- 18 files changed, 86 insertions(+), 101 deletions(-) rename {akka-io => akka-actor-tests}/src/test/scala/akka/io/CapacityLimitSpec.scala (100%) rename {akka-io => akka-actor-tests}/src/test/scala/akka/io/IntegrationSpec.scala (100%) rename {akka-io => akka-actor-tests}/src/test/scala/akka/io/IntegrationSpecSupport.scala (100%) rename {akka-io => akka-actor-tests}/src/test/scala/akka/io/TcpConnectionSpec.scala (100%) rename {akka-io => akka-actor-tests}/src/test/scala/akka/io/TcpListenerSpec.scala (100%) rename {akka-io => akka-actor-tests}/src/test/scala/akka/io/TestUtils.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/DirectByteBufferPool.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/IO.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/Tcp.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/TcpConnection.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/TcpIncomingConnection.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/TcpListener.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/TcpManager.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/TcpOutgoingConnection.scala (100%) rename {akka-io => akka-actor}/src/main/scala/akka/io/TcpSelector.scala (100%) delete mode 100644 akka-io/src/main/resources/reference.conf diff --git a/akka-io/src/test/scala/akka/io/CapacityLimitSpec.scala b/akka-actor-tests/src/test/scala/akka/io/CapacityLimitSpec.scala similarity index 100% rename from akka-io/src/test/scala/akka/io/CapacityLimitSpec.scala rename to akka-actor-tests/src/test/scala/akka/io/CapacityLimitSpec.scala diff --git a/akka-io/src/test/scala/akka/io/IntegrationSpec.scala b/akka-actor-tests/src/test/scala/akka/io/IntegrationSpec.scala similarity index 100% rename from akka-io/src/test/scala/akka/io/IntegrationSpec.scala rename to akka-actor-tests/src/test/scala/akka/io/IntegrationSpec.scala diff --git a/akka-io/src/test/scala/akka/io/IntegrationSpecSupport.scala b/akka-actor-tests/src/test/scala/akka/io/IntegrationSpecSupport.scala similarity index 100% rename from akka-io/src/test/scala/akka/io/IntegrationSpecSupport.scala rename to akka-actor-tests/src/test/scala/akka/io/IntegrationSpecSupport.scala diff --git a/akka-io/src/test/scala/akka/io/TcpConnectionSpec.scala b/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala similarity index 100% rename from akka-io/src/test/scala/akka/io/TcpConnectionSpec.scala rename to akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala diff --git a/akka-io/src/test/scala/akka/io/TcpListenerSpec.scala b/akka-actor-tests/src/test/scala/akka/io/TcpListenerSpec.scala similarity index 100% rename from akka-io/src/test/scala/akka/io/TcpListenerSpec.scala rename to akka-actor-tests/src/test/scala/akka/io/TcpListenerSpec.scala diff --git a/akka-io/src/test/scala/akka/io/TestUtils.scala b/akka-actor-tests/src/test/scala/akka/io/TestUtils.scala similarity index 100% rename from akka-io/src/test/scala/akka/io/TestUtils.scala rename to akka-actor-tests/src/test/scala/akka/io/TestUtils.scala diff --git a/akka-actor/src/main/resources/reference.conf b/akka-actor/src/main/resources/reference.conf index aeee89a65f..9d86ff75b2 100644 --- a/akka-actor/src/main/resources/reference.conf +++ b/akka-actor/src/main/resources/reference.conf @@ -368,6 +368,90 @@ akka { } io { + + # By default the select loops run on dedicated threads, hence using a + # PinnedDispatcher + pinned-dispatcher { + type = "PinnedDispatcher" + executor = "thread-pool-executor" + thread-pool-executor.allow-core-pool-timeout = off + } + + tcp { + + # The number of selectors to stripe the served channels over; each of + # these will use one select loop on the selector-dispatcher. + nr-of-selectors = 1 + + # Maximum number of open channels supported by this TCP module; there is + # no intrinsic general limit, this setting is meant to enable DoS + # protection by limiting the number of concurrently connected clients. + # Also note that this is a "soft" limit; in certain cases the implementation + # will accept a few connections more or a few less than the number configured + # here. Must be an integer > 0 or "unlimited". + max-channels = 256000 + + # The select loop can be used in two modes: + # - setting "infinite" will select without a timeout, hogging a thread + # - setting a positive timeout will do a bounded select call, + # enabling sharing of a single thread between multiple selectors + # (in this case you will have to use a different configuration for the + # selector-dispatcher, e.g. using "type=Dispatcher" with size 1) + # - setting it to zero means polling, i.e. calling selectNow() + select-timeout = infinite + + # When trying to assign a new connection to a selector and the chosen + # selector is at full capacity, retry selector choosing and assignment + # this many times before giving up + selector-association-retries = 10 + + # The maximum number of connection that are accepted in one go, + # higher numbers decrease latency, lower numbers increase fairness on + # the worker-dispatcher + batch-accept-limit = 10 + + # The number of bytes per direct buffer in the pool used to read or write + # network data from the kernel. + direct-buffer-size = 128 KiB + + # The maximal number of direct buffers kept in the direct buffer pool for + # reuse. + max-direct-buffer-pool-size = 1000 + + # The duration a connection actor waits for a `Register` message from + # its commander before aborting the connection. + register-timeout = 5s + + # The maximum number of bytes delivered by a `Received` message. Before + # more data is read from the network the connection actor will try to + # do other work. + received-message-size-limit = unlimited + + # Enable fine grained logging of what goes on inside the implementation. + # Be aware that this may log more than once per message sent to the actors + # of the tcp implementation. + trace-logging = off + + # Fully qualified config path which holds the dispatcher configuration + # to be used for running the select() calls in the selectors + selector-dispatcher = "akka.io.pinned-dispatcher" + + # Fully qualified config path which holds the dispatcher configuration + # for the read/write worker actors + worker-dispatcher = "akka.actor.default-dispatcher" + + # Fully qualified config path which holds the dispatcher configuration + # for the selector management actors + management-dispatcher = "akka.actor.default-dispatcher" + } + + # IMPORTANT NOTICE: + # + # The following settings belong to the deprecated akka.actor.IO + # implementation and will be removed once that is removed. They are not + # taken into account by the akka.io.* implementation, which is configured + # above! + # In bytes, the size of the shared read buffer. In the span 0b..2GiB. # read-buffer-size = 8KiB diff --git a/akka-io/src/main/scala/akka/io/DirectByteBufferPool.scala b/akka-actor/src/main/scala/akka/io/DirectByteBufferPool.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/DirectByteBufferPool.scala rename to akka-actor/src/main/scala/akka/io/DirectByteBufferPool.scala diff --git a/akka-io/src/main/scala/akka/io/IO.scala b/akka-actor/src/main/scala/akka/io/IO.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/IO.scala rename to akka-actor/src/main/scala/akka/io/IO.scala diff --git a/akka-io/src/main/scala/akka/io/Tcp.scala b/akka-actor/src/main/scala/akka/io/Tcp.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/Tcp.scala rename to akka-actor/src/main/scala/akka/io/Tcp.scala diff --git a/akka-io/src/main/scala/akka/io/TcpConnection.scala b/akka-actor/src/main/scala/akka/io/TcpConnection.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/TcpConnection.scala rename to akka-actor/src/main/scala/akka/io/TcpConnection.scala diff --git a/akka-io/src/main/scala/akka/io/TcpIncomingConnection.scala b/akka-actor/src/main/scala/akka/io/TcpIncomingConnection.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/TcpIncomingConnection.scala rename to akka-actor/src/main/scala/akka/io/TcpIncomingConnection.scala diff --git a/akka-io/src/main/scala/akka/io/TcpListener.scala b/akka-actor/src/main/scala/akka/io/TcpListener.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/TcpListener.scala rename to akka-actor/src/main/scala/akka/io/TcpListener.scala diff --git a/akka-io/src/main/scala/akka/io/TcpManager.scala b/akka-actor/src/main/scala/akka/io/TcpManager.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/TcpManager.scala rename to akka-actor/src/main/scala/akka/io/TcpManager.scala diff --git a/akka-io/src/main/scala/akka/io/TcpOutgoingConnection.scala b/akka-actor/src/main/scala/akka/io/TcpOutgoingConnection.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/TcpOutgoingConnection.scala rename to akka-actor/src/main/scala/akka/io/TcpOutgoingConnection.scala diff --git a/akka-io/src/main/scala/akka/io/TcpSelector.scala b/akka-actor/src/main/scala/akka/io/TcpSelector.scala similarity index 100% rename from akka-io/src/main/scala/akka/io/TcpSelector.scala rename to akka-actor/src/main/scala/akka/io/TcpSelector.scala diff --git a/akka-io/src/main/resources/reference.conf b/akka-io/src/main/resources/reference.conf deleted file mode 100644 index 1c4e47263d..0000000000 --- a/akka-io/src/main/resources/reference.conf +++ /dev/null @@ -1,90 +0,0 @@ -################################# -# Akka IO Reference Config File # -################################# - -# This is the reference config file that contains all the default settings. -# Make your edits/overrides in your application.conf. - -akka { - - io { - - # By default the select loops run on dedicated threads, hence using a - # PinnedDispatcher - pinned-dispatcher { - type = "PinnedDispatcher" - executor = "thread-pool-executor" - thread-pool-executor.allow-core-pool-timeout = off - } - - tcp { - - # The number of selectors to stripe the served channels over; each of - # these will use one select loop on the selector-dispatcher. - nr-of-selectors = 1 - - # Maximum number of open channels supported by this TCP module; there is - # no intrinsic general limit, this setting is meant to enable DoS - # protection by limiting the number of concurrently connected clients. - # Also note that this is a "soft" limit; in certain cases the implementation - # will accept a few connections more or a few less than the number configured - # here. Must be an integer > 0 or "unlimited". - max-channels = 256000 - - # The select loop can be used in two modes: - # - setting "infinite" will select without a timeout, hogging a thread - # - setting a positive timeout will do a bounded select call, - # enabling sharing of a single thread between multiple selectors - # (in this case you will have to use a different configuration for the - # selector-dispatcher, e.g. using "type=Dispatcher" with size 1) - # - setting it to zero means polling, i.e. calling selectNow() - select-timeout = infinite - - # When trying to assign a new connection to a selector and the chosen - # selector is at full capacity, retry selector choosing and assignment - # this many times before giving up - selector-association-retries = 10 - - # The maximum number of connection that are accepted in one go, - # higher numbers decrease latency, lower numbers increase fairness on - # the worker-dispatcher - batch-accept-limit = 10 - - # The number of bytes per direct buffer in the pool used to read or write - # network data from the kernel. - direct-buffer-size = 128 KiB - - # The maximal number of direct buffers kept in the direct buffer pool for - # reuse. - max-direct-buffer-pool-size = 1000 - - # The duration a connection actor waits for a `Register` message from - # its commander before aborting the connection. - register-timeout = 5s - - # The maximum number of bytes delivered by a `Received` message. Before - # more data is read from the network the connection actor will try to - # do other work. - received-message-size-limit = unlimited - - # Enable fine grained logging of what goes on inside the implementation. - # Be aware that this may log more than once per message sent to the actors - # of the tcp implementation. - trace-logging = off - - # Fully qualified config path which holds the dispatcher configuration - # to be used for running the select() calls in the selectors - selector-dispatcher = "akka.io.pinned-dispatcher" - - # Fully qualified config path which holds the dispatcher configuration - # for the read/write worker actors - worker-dispatcher = "akka.actor.default-dispatcher" - - # Fully qualified config path which holds the dispatcher configuration - # for the selector management actors - management-dispatcher = "akka.actor.default-dispatcher" - } - - } - -} diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index d1b1c66aa8..6bca2ff7c0 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -73,7 +73,7 @@ object AkkaBuild extends Build { generatedPdf in Sphinx <<= generatedPdf in Sphinx in LocalProject(docs.id) map identity ), - aggregate = Seq(actor, testkit, actorTests, dataflow, io, remote, remoteTests, camel, cluster, slf4j, agent, transactor, mailboxes, zeroMQ, kernel, akkaSbtPlugin, osgi, osgiAries, docs, contrib, samples) + aggregate = Seq(actor, testkit, actorTests, dataflow, remote, remoteTests, camel, cluster, slf4j, agent, transactor, mailboxes, zeroMQ, kernel, akkaSbtPlugin, osgi, osgiAries, docs, contrib, samples) ) lazy val actor = Project( @@ -100,13 +100,6 @@ object AkkaBuild extends Build { settings = defaultSettings ++ OSGi.dataflow ++ cpsPlugin ) - lazy val io = Project( - id = "akka-io", - base = file("akka-io"), - dependencies = Seq(actor, testkit % "test->test"), - settings = defaultSettings ++ OSGi.io - ) - lazy val testkit = Project( id = "akka-testkit", base = file("akka-testkit"), @@ -371,7 +364,7 @@ object AkkaBuild extends Build { lazy val docs = Project( id = "akka-docs", base = file("akka-docs"), - dependencies = Seq(actor, testkit % "test->test", mailboxesCommon % "compile;test->test", io, + dependencies = Seq(actor, testkit % "test->test", mailboxesCommon % "compile;test->test", remote, cluster, slf4j, agent, dataflow, transactor, fileMailbox, zeroMQ, camel, osgi, osgiAries), settings = defaultSettings ++ site.settings ++ site.sphinxSupport() ++ site.publishSite ++ sphinxPreprocessing ++ cpsPlugin ++ Seq( sourceDirectory in Sphinx <<= baseDirectory / "rst", @@ -658,8 +651,6 @@ object AkkaBuild extends Build { val fileMailbox = exports(Seq("akka.actor.mailbox.filebased.*")) - val io = exports(Seq("akka.io.*")) - val mailboxesCommon = exports(Seq("akka.actor.mailbox.*"), imports = Seq(protobufImport())) val osgi = exports(Seq("akka.osgi")) ++ Seq(OsgiKeys.privatePackage := Seq("akka.osgi.impl"))