读取akka.conf文件在内部会发生什么?

时间:2018-06-27 09:26:36

标签: akka actor ignite opendaylight akka-persistence

我正在使用OpenDaylight,并尝试用Apache Ignite替换默认的分布式数据库。 我正在使用通过此处的源代码获得的jar: https://github.com/Romeh/akka-persistance-ignite并将其部署在OpenDaylight karaf容器中。

以下是我在OpenDaylight中使用的akka​​.conf文件的一部分,用Apache Ignite替换LevelDB日志。

odl-cluster-data {
  akka {
  loglevel = DEBUG

  actor {
    provider = "akka.cluster.ClusterActorRefProvider"

    default-dispatcher {
      # Configuration for the fork join pool
       fork-join-executor {
        # Min number of threads to cap factor-based parallelism number to
        parallelism-min = 2
        # Parallelism (threads) ... ceil(available processors * factor)
        parallelism-factor = 2.0
        # Max number of threads to cap factor-based parallelism number to
        parallelism-max = 10
      }
      # Throughput defines the maximum number of messages to be
      # processed per actor before the thread jumps to the next actor.
       # Set to 1 for as fair as possible.
       throughput = 10
    }
  }

  remote {
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "10.145.59.44"
      port = 2551
   }
  }

  cluster {
     seed-nodes = [
      "akka.tcp://test@127.0.0.1:2551"
    ]
     min-nr-of-members = 1
    auto-down-unreachable-after = 30s
   }



# Disable legacy metrics in akka-cluster.
 akka.cluster.metrics.enabled=off

akka.persistence.journal.plugin = "akka.persistence.journal.ignite"
akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot.ignite"


   extensions = ["akka.persistence.ignite.extension.IgniteExtensionProvider"]



   persistence {
     # Ignite journal plugin
     journal {
       ignite {
         # Class name of the plugin
         class = "akka.persistence.ignite.journal.IgniteWriteJournal"
     plugin-dispatcher = "ignite-dispatcher"
         cache-prefix = "akka-journal"
         // Should be based into the the dara grid topology
        cache-backups = 1
         // if ignite is already started in a separate standalone grid where journal cache is already created
         cachesAlreadyCreated = false
      }
    }

    # Ignite snapshot plugin
    snapshot {
      ignite {
        # Class name of the plugin
        class = "akka.persistence.ignite.snapshot.IgniteSnapshotStore"
    plugin-dispatcher = "ignite-dispatcher"
        cache-prefix = "akka-snapshot"
        // Should be based into the the dara grid topology
        cache-backups = 1
        // if ignite is already started in a separate standalone grid where snapshot cache is already created
        cachesAlreadyCreated = false
      }
    }
  }

   }


}

但是,类IgniteWriteJournal似乎没有加载,我已经通过如下方式将一些打印语句放入其构造器中进行了检查。

 public IgniteWriteJournal(Config config) throws NotSerializableException {
        System.out.println("!@#$% inside IgniteWriteJournal constructor\n");
        ActorSystem actorSystem = context().system();
         serializer = SerializationExtension.get(actorSystem).serializerFor(PersistentRepr.class);
         storage = new Store<>(actorSystem);

        JournalCaches journalCaches = journalCacheProvider.apply(config, actorSystem);
        sequenceNumberTrack = journalCaches.getSequenceCache();
        cache = journalCaches.getJournalCache();
}

那么akka.persistence.journal.ignite标记中提到的类到底发生了什么?该类的构造函数是否被调用?读取akka.conf文件在后台究竟发生了什么?

1 个答案:

答案 0 :(得分:0)

在哪里寻找打印输出-在data / log / karaf.log中? System.out.println不会到那里-使用org.slf4j.Logger。

您如何重建IgniteWriteJournal源并部署新工件?您确定更改已真正部署吗?