Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra Cluster Example Add Check for Null Endpoints (redo2) #5808

Merged
merged 1 commit into from
Mar 24, 2015

Conversation

mikeln
Copy link
Contributor

@mikeln mikeln commented Mar 23, 2015

Fix for Issue: Cassandra Cluster Example Custom Seed Cores on First Node #5737

Also note: for this change to be effective, the following jar must be rebuilt and checked in:

kubernetes/examples/cassandra/image/kubernetes-cassandra.jar

However, this example does not have any visible java build and testing infrastructure.

redo of pull previous closed PR: 5764

@roberthbailey
Copy link
Contributor

Assigning to @brendandburns since he added the Cassandra example originally.

Brendan - How did you build the jar file? Can we add instructions (or a script) to the repository to make it easier to reproduce as we tweak the example in the future?

@brendandburns
Copy link
Contributor

LGTM.
I created that jar with:

javac io/k8s/cassandra/KubernetesSeedProvider.java
jar cf kubernetes-cassandra.jar classes/

I can add a script to build that jar file. Building it requires that you have cassandra installed, I'm not sure we want to add that to our dependency tree. I'm happy to add a script though (or Mike can if he prefers)

--brendan

@mikeln
Copy link
Contributor Author

mikeln commented Mar 23, 2015

If you would add the script, and build the jar.

The issue I had with building the jar were several dependencies (at least with my setup) that weren't just cassandra. Lead me to believe my setup is different from the original build setup. My .pom deps:

<dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.5</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.6.3</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.6.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cassandra</groupId>
        <artifactId>cassandra-all</artifactId>
        <version>2.0.11</version>
    </dependency>

@mikeln
Copy link
Contributor Author

mikeln commented Mar 23, 2015

Actually, maybe it would be better to add my maven build setup. In that way, there are no direct dependencies on other projects. However, to add this will require a restructure of the java/ subdirectory to conform to maven's preferred structure.

.
├── pom.xml
└── src
    ├── main
    │   └── java
    │       └── io
    │           └── k8s
    │               └── cassandra
    │                   └── KubernetesSeedProvider.java
    └── test
        └── java
            └── io
                └── k8s
                    └── cassandra
                        └── AppTest.java

mvn package builds this additional tree:

target
├── classes
│   └── io
│       └── k8s
│           └── cassandra
│               ├── KubernetesSeedProvider$Endpoints.class
│               └── KubernetesSeedProvider.class
├── kubernetes-cassandra-1.0-SNAPSHOT.jar
├── maven-archiver
│   └── pom.properties
├── maven-status
│   └── maven-compiler-plugin
│       ├── compile
│       │   └── default-compile
│       │       ├── createdFiles.lst
│       │       └── inputFiles.lst
│       └── testCompile
│           └── default-testCompile
│               ├── createdFiles.lst
│               └── inputFiles.lst
├── surefire-reports
│   ├── TEST-io.k8s.cassandra.AppTest.xml
│   └── io.k8s.cassandra.AppTest.txt
└── test-classes
    └── io
        └── k8s
            └── cassandra
                └── AppTest.class

Of which only the kubernetes-cassandra-1.0-SNAPSHOT.jar is really all you want. Then copy it into the image dir:

cp target/kubernetes-cassandra-1.0-SNAPSHOT.jar  ../image/kubernetes-cassandra.jar

NOTE: I am no maven expert. The AppTest does nothing in this setup except return "passed" and there may be a maven plugin to nicely handle copying the .jar file to the correct place.

@brendandburns
Copy link
Contributor

oh, I like the maven approach... will merge this, and then send a PR to support Maven.

Thanks!
--brendan

brendandburns added a commit that referenced this pull request Mar 24, 2015
Cassandra Cluster Example Add Check for Null Endpoints (redo2)
@brendandburns brendandburns merged commit 9707a94 into kubernetes:master Mar 24, 2015
@mikeln mikeln deleted the issue-5737 branch March 24, 2015 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants