Что происходит внутри, когда читается файл akka.conf? - PullRequest
0 голосов
/ 27 июня 2018

Я использую OpenDaylight и пытаюсь заменить распределенную базу данных по умолчанию на Apache Ignite. Я использую банку, полученную с помощью исходного кода здесь: https://github.com/Romeh/akka-persistance-ignite и развернул его в контейнере OpenDaylight karaf.

Ниже приведен фрагмент файла akka.conf, который я использую в OpenDaylight для замены журнала LevelDB на Apache Ignite.

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, похоже, не загружается, что я проверил, поместив некоторые операторы печати в его constuructor следующим образом.

 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 голосов
/ 27 июня 2018

Где искать распечатки - в data / log / karaf.log? System.out.println не идет туда - используйте org.slf4j.Logger.

Как вы перестроили исходный код IgniteWriteJournal и развернули новый артефакт? Вы уверены, что ваши изменения действительно были развернуты?

...