Search in sources :

Example 1 with FileLockNodeManager

use of org.apache.activemq.artemis.core.server.impl.FileLockNodeManager in project activemq-artemis by apache.

the class PrintData method printData.

public static void printData(File bindingsDirectory, File messagesDirectory, File pagingDirectory, PrintStream out, boolean safe) throws Exception {
    // Having the version on the data report is an information very useful to understand what happened
    // When debugging stuff
    Artemis.printBanner(out);
    File serverLockFile = new File(messagesDirectory, "server.lock");
    if (serverLockFile.isFile()) {
        try {
            FileLockNodeManager fileLock = new FileLockNodeManager(messagesDirectory, false);
            fileLock.start();
            printBanner(out, "Server's ID=" + fileLock.getNodeId().toString());
            fileLock.stop();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    printBanner(out, BINDINGS_BANNER);
    try {
        DescribeJournal.describeBindingsJournal(bindingsDirectory, out, safe);
    } catch (Exception e) {
        e.printStackTrace();
    }
    printBanner(out, MESSAGES_BANNER);
    DescribeJournal describeJournal = null;
    try {
        describeJournal = DescribeJournal.describeMessagesJournal(messagesDirectory, out, safe);
    } catch (Exception e) {
        e.printStackTrace();
        return;
    }
    try {
        printBanner(out, "P A G I N G");
        printPages(pagingDirectory, describeJournal, out, safe);
    } catch (Exception e) {
        e.printStackTrace();
        return;
    }
}
Also used : FileLockNodeManager(org.apache.activemq.artemis.core.server.impl.FileLockNodeManager) DescribeJournal(org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal) File(java.io.File)

Example 2 with FileLockNodeManager

use of org.apache.activemq.artemis.core.server.impl.FileLockNodeManager in project activemq-artemis by apache.

the class NodeManagerAction method main.

public static void main(String[] args) throws Exception {
    int[] work1 = new int[args.length];
    for (int i = 0; i < args.length; i++) {
        work1[i] = Integer.parseInt(args[i]);
    }
    NodeManagerAction nodeManagerAction = new NodeManagerAction(work1);
    FileLockNodeManager nodeManager = new FileLockNodeManager(new File("."), false);
    nodeManager.start();
    try {
        nodeManagerAction.performWork(nodeManager);
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(9);
    }
    System.out.println("work performed");
}
Also used : FileLockNodeManager(org.apache.activemq.artemis.core.server.impl.FileLockNodeManager) File(java.io.File)

Example 3 with FileLockNodeManager

use of org.apache.activemq.artemis.core.server.impl.FileLockNodeManager in project activemq-artemis by apache.

the class RealNodeManagerTest method testId.

@Test
public void testId() throws Exception {
    NodeManager nodeManager = new FileLockNodeManager(new File(getTemporaryDir()), false);
    nodeManager.start();
    UUID id1 = nodeManager.getUUID();
    nodeManager.stop();
    nodeManager.start();
    ActiveMQTestBase.assertEqualsByteArrays(id1.asBytes(), nodeManager.getUUID().asBytes());
    nodeManager.stop();
}
Also used : FileLockNodeManager(org.apache.activemq.artemis.core.server.impl.FileLockNodeManager) NodeManager(org.apache.activemq.artemis.core.server.NodeManager) FileLockNodeManager(org.apache.activemq.artemis.core.server.impl.FileLockNodeManager) UUID(org.apache.activemq.artemis.utils.UUID) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)3 FileLockNodeManager (org.apache.activemq.artemis.core.server.impl.FileLockNodeManager)3 DescribeJournal (org.apache.activemq.artemis.core.persistence.impl.journal.DescribeJournal)1 NodeManager (org.apache.activemq.artemis.core.server.NodeManager)1 UUID (org.apache.activemq.artemis.utils.UUID)1 Test (org.junit.Test)1