Permalink
Browse files

Update to new build scripts.

Describe ring can filter by dc and rack.
Filter out empty rows from AllRowsQuery
Added separate recipe to AllRowsReader
Added checkpoint manager to resume AllRowsQuery/Reader
  • Loading branch information...
1 parent 5c05d11 commit a255e636942469091027401ea62bd7be2c36597e @elandau elandau committed Sep 11, 2012
Showing with 1,767 additions and 239 deletions.
  1. +42 −28 build.gradle
  2. +1 −0 gradle.properties
  3. +12 −0 gradle/buildscript.gradle
  4. +23 −19 gradle/check.gradle
  5. +29 −18 gradle/convention.gradle
  6. +8 −4 gradle/license.gradle
  7. +27 −40 gradle/maven.gradle
  8. +1 −1 gradle/netflix-oss.gradle
  9. +64 −3 gradle/release.gradle
  10. +2 −2 gradle/wrapper/gradle-wrapper.properties
  11. +2 −2 gradlew
  12. +0 −1 netflix-oss.gradle
  13. +14 −3 pom.xml
  14. +0 −1 settings.gradle
  15. +8 −0 src/main/java/com/netflix/astyanax/CassandraOperationCategory.java
  16. +42 −1 src/main/java/com/netflix/astyanax/CassandraOperationType.java
  17. +6 −0 src/main/java/com/netflix/astyanax/ColumnListMutation.java
  18. +38 −1 src/main/java/com/netflix/astyanax/Keyspace.java
  19. +25 −7 src/main/java/com/netflix/astyanax/connectionpool/Host.java
  20. +10 −10 src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java
  21. +1 −1 src/main/java/com/netflix/astyanax/connectionpool/impl/ConnectionPoolConfigurationImpl.java
  22. +48 −21 src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java
  23. +11 −2 src/main/java/com/netflix/astyanax/connectionpool/impl/RoundRobinExecuteWithFailover.java
  24. +56 −23 src/main/java/com/netflix/astyanax/connectionpool/impl/TokenPartitionedTopology.java
  25. +31 −0 src/main/java/com/netflix/astyanax/ddl/ColumnDefinition.java
  26. +80 −0 src/main/java/com/netflix/astyanax/impl/AstyanaxCheckpointManager.java
  27. +4 −2 src/main/java/com/netflix/astyanax/impl/AstyanaxConfigurationImpl.java
  28. +24 −5 src/main/java/com/netflix/astyanax/impl/RingDescribeHostSupplier.java
  29. +73 −0 src/main/java/com/netflix/astyanax/partitioner/BOP20Partitioner.java
  30. +74 −0 src/main/java/com/netflix/astyanax/partitioner/BigInteger127Partitioner.java
  31. +57 −0 src/main/java/com/netflix/astyanax/partitioner/Partitioner.java
  32. +32 −0 src/main/java/com/netflix/astyanax/query/AllRowsQuery.java
  33. +44 −0 src/main/java/com/netflix/astyanax/query/CheckpointManager.java
  34. +2 −1 src/main/java/com/netflix/astyanax/query/ColumnFamilyQuery.java
  35. +515 −0 src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java
  36. +3 −2 src/main/java/com/netflix/astyanax/retry/BoundedExponentialBackoff.java
  37. +32 −0 src/main/java/com/netflix/astyanax/shallows/EmptyCheckpointManager.java
  38. +22 −0 src/main/java/com/netflix/astyanax/test/TestKeyspace.java
  39. +49 −1 src/main/java/com/netflix/astyanax/thrift/AbstractThriftAllRowsQueryImpl.java
  40. +39 −7 src/main/java/com/netflix/astyanax/thrift/ThriftAllRowsImpl.java
  41. +63 −15 src/main/java/com/netflix/astyanax/thrift/ThriftColumnFamilyQueryImpl.java
  42. +1 −1 src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java
  43. +52 −12 src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java
  44. +12 −1 src/main/java/com/netflix/astyanax/thrift/ThriftSyncConnectionFactoryImpl.java
  45. +33 −1 src/main/java/com/netflix/astyanax/thrift/ddl/ThriftColumnDefinitionImpl.java
  46. +21 −0 src/main/java/com/netflix/astyanax/util/BarrierCallableDecorator.java
  47. +16 −0 src/main/java/com/netflix/astyanax/util/Callables.java
  48. +14 −1 src/main/java/com/netflix/astyanax/util/TokenGenerator.java
  49. +2 −1 src/test/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPoolTest.java
  50. +2 −1 src/test/java/com/netflix/astyanax/impl/RingDescribeHostSupplierTest.java
View
@@ -1,47 +1,61 @@
// Establish version and status
-ext.releaseVersion = '1.0.5'
-ext.githubProjectName = name
-group = 'com.netflix.astyanax'
+ext.githubProjectName = rootProject.name // Change if github project name is not the same as the root project's name
buildscript {
repositories { mavenCentral() }
+ apply from: file('gradle/buildscript.gradle'), to: buildscript
}
allprojects {
repositories { mavenCentral() }
}
-//apply from: file('gradle/release.gradle') // Not fully tested
apply from: file('gradle/convention.gradle')
apply from: file('gradle/maven.gradle')
apply from: file('gradle/check.gradle')
-//apply from: file('gradle/license.gradle') // Waiting for re-release
-
-// Closure to configure all the POM with extra info, common to all projects
-pom {
- project {
- url "https://github.com/Netflix/${githubProjectName}"
- scm {
- connection "scm:git:git@github.com:Netflix/${githubProjectName}.git"
- url "scm:git:git@github.com:Netflix/${githubProjectName}.git"
- developerConnection "scm:git:git@github.com:Netflix/${githubProjectName}.git"
- }
- issueManagement {
- system 'github'
- url "https://github.com/Netflix/${githubProjectName}/issues"
+apply from: file('gradle/license.gradle')
+apply from: file('gradle/release.gradle')
+
+subprojects {
+ // Closure to configure all the POM with extra info, common to all projects
+ pom {
+ project {
+ url "https://github.com/Netflix/${rootProject.githubProjectName}"
+ scm {
+ connection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
+ url "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
+ developerConnection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git"
+ }
+ issueManagement {
+ system 'github'
+ url "https://github.com/Netflix/${rootProject.githubProjectName}/issues"
+ }
}
}
+
+ group = "com.netflix.${githubProjectName}" // TEMPLATE: Set to organization of project
+
+ dependencies {
+ compile 'javax.ws.rs:jsr311-api:1.1.1'
+ compile 'com.sun.jersey:jersey-core:1.11'
+ testCompile 'org.testng:testng:6.1.1'
+ testCompile 'org.mockito:mockito-core:1.8.5'
+ }
}
-dependencies {
- compile 'joda-time:joda-time:2.0'
- compile 'org.apache.servicemix.bundles:org.apache.servicemix.bundles.commons-csv:1.0-r706900_3'
- compile 'com.github.stephenc.high-scale-lib:high-scale-lib:1.1.2'
- compile 'com.google.guava:guava:11.0.2'
- compile 'org.apache.cassandra:cassandra-all:1.1.0'
- compile 'com.github.stephenc.eaio-uuid:uuid:3.2.0'
- compile 'org.slf4j:slf4j-api:1.6.4'
- compile 'org.codehaus.jettison:jettison:1.3.1'
- testCompile 'junit:junit:4.8.1'
+project(':') {
+ apply plugin: 'java'
+ dependencies {
+ compile 'joda-time:joda-time:2.0'
+ compile 'org.apache.servicemix.bundles:org.apache.servicemix.bundles.commons-csv:1.0-r706900_3'
+ compile 'com.github.stephenc.high-scale-lib:high-scale-lib:1.1.2'
+ compile 'com.google.guava:guava:11.0'
+ compile 'org.apache.cassandra:cassandra-all:1.1.0'
+ compile 'com.github.stephenc.eaio-uuid:uuid:3.2.0'
+ compile 'org.slf4j:slf4j-api:1.6.4'
+ compile 'org.codehaus.jettison:jettison:1.3.1'
+ compile 'commons-codec:commons-codec:1.6'
+ testCompile 'junit:junit:4.8.1'
+ }
}
View
@@ -0,0 +1 @@
+version=1.54-SNAPSHOT
View
@@ -0,0 +1,12 @@
+// Executed in context of buildscript
+repositories {
+ maven {
+ name 'build-repo'
+ url 'https://github.com/Netflix-Skunkworks/build-repo/raw/master/releases/'
+ }
+}
+dependencies {
+ classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0'
+ classpath 'com.mapvine:gradle-cobertura-plugin:0.1'
+ classpath 'gradle-release:gradle-release:1.0-SNAPSHOT'
+}
View
@@ -1,21 +1,25 @@
-// Checkstyle
-apply plugin: 'checkstyle'
-tasks.withType(Checkstyle) { ignoreFailures = true }
-checkstyle {
- ignoreFailures = true // Waiting on GRADLE-2163
- configFile = rootProject.file('codequality/checkstyle.xml')
-}
+subprojects {
+ // Checkstyle
+ apply plugin: 'checkstyle'
+ tasks.withType(Checkstyle) { ignoreFailures = true }
+ checkstyle {
+ ignoreFailures = true // Waiting on GRADLE-2163
+ configFile = rootProject.file('codequality/checkstyle.xml')
+ }
+
+ // FindBugs
+ apply plugin: 'findbugs'
+ //tasks.withType(Findbugs) { reports.html.enabled true }
-// FindBugs
-//apply plugin: 'findbugs'
-//findbugs {
-// ignoreFailures = true
-//}
-//tasks.withType(Findbugs) { reports.html.enabled true }
+ // PMD
+ apply plugin: 'pmd'
+ //tasks.withType(Pmd) { reports.html.enabled true }
-// PMD
-//apply plugin: 'pmd'
-//pmd {
-// ignoreFailures = true
-//}
-//tasks.withType(Pmd) { reports.html.enabled true }
+ apply plugin: 'cobertura'
+ cobertura {
+ sourceDirs = sourceSets.main.java.srcDirs
+ format = 'html'
+ includes = ['**/*.java', '**/*.groovy']
+ excludes = []
+ }
+}
View
@@ -1,32 +1,43 @@
-ext.performingRelease = project.hasProperty('release') && Boolean.parseBoolean(project.release)
-def versionPostfix = performingRelease?'':'-SNAPSHOT'
+// For Artifactory
+rootProject.status = version.contains('-SNAPSHOT')?'snapshot':'release'
-apply plugin: 'java' // Plugin as major conventions
+subprojects { project ->
+ apply plugin: 'java' // Plugin as major conventions
-version = "${releaseVersion}${versionPostfix}"
+ version = rootProject.version
-sourceCompatibility = 1.6
+ sourceCompatibility = 1.6
-// GRADLE-2087 workaround, perform after java plugin
-status = performingRelease?'release':'snapshot'
+ // GRADLE-2087 workaround, perform after java plugin
+ status = rootProject.status
-task sourcesJar(type: Jar, dependsOn:classes) {
- classifier = 'sources'
- from sourceSets.main.allSource
-}
+ task sourcesJar(type: Jar, dependsOn:classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+ }
+
+ task javadocJar(type: Jar, dependsOn:javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+ }
+
+ artifacts {
+ archives sourcesJar
+ archives javadocJar
+ }
-task javadocJar(type: Jar, dependsOn:javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
+ javadoc.doFirst { println "" }
}
-artifacts {
- archives sourcesJar
- archives javadocJar
+task aggregateJavadoc(type: Javadoc) {
+ description = 'Aggregate all subproject docs into a single docs directory'
+ source subprojects.collect {project -> project.sourceSets.main.allJava }
+ classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath})
+ destinationDir = new File(projectDir, 'doc')
}
// Generate wrapper, which is distributed as part of source to alleviate the need of installing gradle
task createWrapper(type: Wrapper) {
- gradleVersion = '1.0-milestone-9'
+ gradleVersion = '1.1'
}
View
@@ -1,5 +1,9 @@
-buildscript {
- dependencies { classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.5' }
-}
+// Dependency for plugin was set in buildscript.gradle
-apply plugin: nl.javadude.gradle.plugins.license.LicensePlugin
+subprojects {
+apply plugin: 'license' //nl.javadude.gradle.plugins.license.LicensePlugin
+license {
+ header rootProject.file('codequality/HEADER')
+ ext.year = Calendar.getInstance().get(Calendar.YEAR)
+}
+}
View
@@ -1,56 +1,43 @@
// Maven side of things
-apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work
-apply plugin: 'signing'
+subprojects {
+ apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work
+ apply plugin: 'signing'
-if (gradle.startParameter.taskNames.contains("uploadMavenCentral")) {
signing {
- required true
+ required { gradle.taskGraph.hasTask(uploadMavenCentral) }
sign configurations.archives
}
-} else {
- task signArchives {
- // do nothing
- }
-}
-/**
- * Publishing to Maven Central example provided from http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html
- * artifactory will execute uploadArchives to force generation of ivy.xml, and we don't want that to trigger an upload to maven
- * central, so using custom upload task.
- */
-task uploadMavenCentral(type:Upload) {
- configuration = configurations.archives
- dependsOn 'signArchives'
- doFirst {
- repositories.mavenDeployer {
- beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) }
+ /**
+ * Publishing to Maven Central example provided from http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html
+ */
+ task uploadMavenCentral(type:Upload, dependsOn: signArchives) {
+ configuration = configurations.archives
+ doFirst {
+ repositories.mavenDeployer {
+ beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) }
- // To test deployment locally, use the following instead of oss.sonatype.org
- //repository(url: "file://localhost/${rootProject.rootDir}/repo")
+ // To test deployment locally, use the following instead of oss.sonatype.org
+ //repository(url: "file://localhost/${rootProject.rootDir}/repo")
- repository(url: 'http://oss.sonatype.org/service/local/staging/deploy/maven2/') {
- authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword)
- }
+ repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
+ authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword)
+ }
- // Prevent datastamp from being appending to artifacts during deployment
- uniqueVersion = false
+ // Prevent datastamp from being appending to artifacts during deployment
+ uniqueVersion = false
- // Closure to configure all the POM with extra info, common to all projects
- pom.project {
- parent {
- groupId 'org.sonatype.oss'
- artifactId 'oss-parent'
- version '7'
- }
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution 'repo'
+ // Closure to configure all the POM with extra info, common to all projects
+ pom.project {
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
}
}
}
}
}
}
-
@@ -1 +1 @@
-apply from: 'http://artifacts.netflix.com/build-local/artifactory.gradle'
+apply from: 'http://artifacts.netflix.com/gradle-netflix-local/artifactory.gradle'
View
@@ -1,6 +1,67 @@
-buildscript {
- dependencies { classpath group: 'no.entitas.gradle', name: 'gradle-release-plugin', version: '1.11' }
+apply plugin: 'release'
+
+// Ignore release plugin's task because it calls out via GradleBuild. This is a good place to put an email to send out
+task release(overwrite: true, dependsOn: commitNewVersion) << {
+ // This is a good place to put an email to send out
+}
+commitNewVersion.dependsOn updateVersion
+updateVersion.dependsOn createReleaseTag
+createReleaseTag.dependsOn preTagCommit
+def buildTasks = tasks.matching { it.name =~ /:build/ }
+preTagCommit.dependsOn buildTasks
+preTagCommit.dependsOn checkSnapshotDependencies
+//checkSnapshotDependencies.dependsOn confirmReleaseVersion // Introduced in 1.0, forces readLine
+//confirmReleaseVersion.dependsOn unSnapshotVersion
+checkSnapshotDependencies.dependsOn unSnapshotVersion // Remove once above is fixed
+unSnapshotVersion.dependsOn checkUpdateNeeded
+checkUpdateNeeded.dependsOn checkCommitNeeded
+checkCommitNeeded.dependsOn initScmPlugin
+
+// Call out to compile against internal repository
+task uploadArtifactory(type: GradleBuild) {
+ startParameter = project.gradle.startParameter.newInstance()
+ startParameter.addInitScript( file('gradle/netflix-oss.gradle') )
+ startParameter.getExcludedTaskNames().add('check')
+ tasks = [ 'build', 'artifactoryPublish' ]
}
-apply plugin: no.entitas.gradle.git.GitReleasePlugin // 'gitrelease'
+task releaseArtifactory(dependsOn: [checkSnapshotDependencies, uploadArtifactory])
+task buildWithArtifactory(type: GradleBuild) {
+ startParameter = project.gradle.startParameter.newInstance()
+ startParameter.addInitScript( file('gradle/netflix-oss.gradle') )
+ startParameter.getExcludedTaskNames().add('check')
+ tasks = [ 'build' ]
+}
+
+// Ensure upload happens before taggging but after all pre-checks
+//releaseArtifactory.dependsOn checkSnapshotDependencies
+createReleaseTag.dependsOn releaseArtifactory
+gradle.taskGraph.whenReady { taskGraph ->
+ if ( taskGraph.hasTask(uploadArtifactory) && rootProject.status == 'release' && !taskGraph.hasTask(':release') ) {
+ throw new GradleException('Project has to be release status releasing to Artifactory')
+ }
+}
+subprojects.each { project ->
+ project.uploadMavenCentral.dependsOn rootProject.checkSnapshotDependencies
+ rootProject.createReleaseTag.dependsOn project.uploadMavenCentral
+
+ gradle.taskGraph.whenReady { taskGraph ->
+ if ( taskGraph.hasTask(project.uploadMavenCentral) && !taskGraph.hasTask(':release') ) {
+ throw new GradleException('"release" task has to be run before uploading to Maven Central')
+ }
+ }
+}
+
+// Prevent plugin from asking for a version number interactively
+ext.'gradle.release.useAutomaticVersion' = "true"
+
+release {
+ // http://tellurianring.com/wiki/gradle/release
+ failOnCommitNeeded=true
+ failOnPublishNeeded=true
+ failOnUnversionedFiles=true
+ failOnUpdateNeeded=true
+ includeProjectNameInTag=true
+ requireBranch = null
+}
@@ -1,6 +1,6 @@
-#Wed Mar 14 13:19:56 PDT 2012
+#Tue Aug 14 16:28:54 PDT 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-9-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip
Oops, something went wrong.

0 comments on commit a255e63

Please sign in to comment.