├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── LICENSE ├── NOTICE ├── README.md ├── app ├── conf │ ├── als-example.conf │ ├── kmeans-example.conf │ ├── rdf-classification-example.conf │ ├── rdf-regression-example.conf │ └── wordcount-example.conf ├── example │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── example │ │ │ ├── batch │ │ │ ├── ExampleBatchLayerUpdate.java │ │ │ └── package-info.java │ │ │ ├── serving │ │ │ ├── Add.java │ │ │ ├── Distinct.java │ │ │ ├── ExampleServingModel.java │ │ │ ├── ExampleServingModelManager.java │ │ │ └── package-info.java │ │ │ └── speed │ │ │ ├── ExampleSpeedModelManager.java │ │ │ └── package-info.java │ │ └── scala │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── example │ │ ├── batch │ │ └── ExampleScalaBatchLayerUpdate.scala │ │ ├── serving │ │ └── ExampleScalaServingModelManager.scala │ │ └── speed │ │ └── ExampleScalaSpeedModelManager.scala ├── oryx-app-api │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── app │ │ │ └── als │ │ │ ├── AbstractRescorerProvider.java │ │ │ ├── MultiRescorer.java │ │ │ ├── MultiRescorerProvider.java │ │ │ ├── Rescorer.java │ │ │ └── RescorerProvider.java │ │ └── test │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── app │ │ └── als │ │ ├── AbstractRescorerProviderTest.java │ │ ├── ErrorProvider.java │ │ ├── MultiRescorerProviderTest.java │ │ ├── MultiRescorerTest.java │ │ ├── NullProvider1.java │ │ ├── SimpleModRescorer.java │ │ └── SimpleModRescorerProvider.java ├── oryx-app-common │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cloudera │ │ │ │ └── oryx │ │ │ │ └── app │ │ │ │ ├── als │ │ │ │ ├── ALSUtils.java │ │ │ │ ├── FeatureVectors.java │ │ │ │ ├── FeatureVectorsPartition.java │ │ │ │ ├── PartitionedFeatureVectors.java │ │ │ │ ├── SolverCache.java │ │ │ │ └── package-info.java │ │ │ │ ├── classreg │ │ │ │ ├── example │ │ │ │ │ ├── CategoricalFeature.java │ │ │ │ │ ├── Example.java │ │ │ │ │ ├── ExampleUtils.java │ │ │ │ │ ├── Feature.java │ │ │ │ │ ├── FeatureType.java │ │ │ │ │ ├── NumericFeature.java │ │ │ │ │ └── package-info.java │ │ │ │ └── predict │ │ │ │ │ ├── CategoricalPrediction.java │ │ │ │ │ ├── NumericPrediction.java │ │ │ │ │ ├── Prediction.java │ │ │ │ │ ├── WeightedPrediction.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── common │ │ │ │ └── fn │ │ │ │ │ ├── MLFunctions.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── kmeans │ │ │ │ ├── ClusterInfo.java │ │ │ │ ├── DistanceFn.java │ │ │ │ ├── EuclideanDistanceFn.java │ │ │ │ ├── KMeansPMMLUtils.java │ │ │ │ ├── KMeansUtils.java │ │ │ │ └── package-info.java │ │ │ │ ├── pmml │ │ │ │ ├── AppPMMLUtils.java │ │ │ │ └── package-info.java │ │ │ │ ├── rdf │ │ │ │ ├── RDFPMMLUtils.java │ │ │ │ ├── decision │ │ │ │ │ ├── CategoricalDecision.java │ │ │ │ │ ├── Decision.java │ │ │ │ │ ├── NumericDecision.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ └── tree │ │ │ │ │ ├── DecisionForest.java │ │ │ │ │ ├── DecisionNode.java │ │ │ │ │ ├── DecisionTree.java │ │ │ │ │ ├── TerminalNode.java │ │ │ │ │ ├── TreeBasedClassifier.java │ │ │ │ │ ├── TreeNode.java │ │ │ │ │ ├── TreePath.java │ │ │ │ │ └── package-info.java │ │ │ │ └── schema │ │ │ │ ├── CategoricalValueEncodings.java │ │ │ │ ├── InputSchema.java │ │ │ │ └── package-info.java │ │ └── resources │ │ │ └── reference.conf │ │ └── test │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── app │ │ ├── als │ │ ├── ALSUtilsTest.java │ │ ├── AbstractFeatureVectorTest.java │ │ ├── FeatureVectorsPartitionTest.java │ │ ├── PartitionedFeatureVectorsTest.java │ │ └── SolverCacheTest.java │ │ ├── classreg │ │ ├── example │ │ │ ├── CategoricalFeatureTest.java │ │ │ ├── ExampleUtilsTest.java │ │ │ └── NumericFeatureTest.java │ │ └── predict │ │ │ ├── CategoricalPredictionTest.java │ │ │ ├── NumericPredictionTest.java │ │ │ └── WeightedPredictionTest.java │ │ ├── common │ │ └── fn │ │ │ └── MLFunctionsTest.java │ │ ├── kmeans │ │ ├── ClusterInfoTest.java │ │ ├── EuclideanDistanceFnTest.java │ │ ├── KMeansPMMLUtilsTest.java │ │ └── KMeansUtilsTest.java │ │ ├── pmml │ │ └── AppPMMLUtilsTest.java │ │ ├── rdf │ │ ├── RDFPMMLUtilsTest.java │ │ ├── decision │ │ │ ├── CategoricalDecisionTest.java │ │ │ └── NumericDecisionTest.java │ │ └── tree │ │ │ ├── DecisionForestTest.java │ │ │ ├── DecisionNodeTest.java │ │ │ ├── DecisionTreeTest.java │ │ │ ├── TerminalNodeTest.java │ │ │ └── TreePathTest.java │ │ └── schema │ │ ├── CategoricalValueEncodingsTest.java │ │ └── InputSchemaTest.java ├── oryx-app-mllib │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── app │ │ │ └── batch │ │ │ └── mllib │ │ │ ├── als │ │ │ ├── ALSUpdate.java │ │ │ ├── EnqueueFeatureVecsAndKnownItemsFn.java │ │ │ ├── EnqueueFeatureVecsFn.java │ │ │ ├── Evaluation.java │ │ │ └── package-info.java │ │ │ ├── kmeans │ │ │ ├── AbstractKMeansEvaluation.java │ │ │ ├── ClusterMetric.java │ │ │ ├── DaviesBouldinIndex.java │ │ │ ├── DunnIndex.java │ │ │ ├── KMeansEvalStrategy.java │ │ │ ├── KMeansUpdate.java │ │ │ ├── SilhouetteCoefficient.java │ │ │ ├── SumSquaredError.java │ │ │ └── package-info.java │ │ │ └── rdf │ │ │ ├── Evaluation.java │ │ │ ├── RDFUpdate.java │ │ │ └── package-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── app │ │ └── batch │ │ └── mllib │ │ ├── AbstractAppMLlibIT.java │ │ ├── als │ │ ├── ALSHyperParamTuningIT.java │ │ ├── ALSModelContentIT.java │ │ ├── ALSUpdateIT.java │ │ ├── ALSUpdateTest.java │ │ ├── AbstractALSIT.java │ │ ├── FeaturesALSDataGenerator.java │ │ ├── ModelContentDataGenerator.java │ │ └── RandomALSDataGenerator.java │ │ ├── kmeans │ │ ├── AbstractKMeansIT.java │ │ ├── KMeansEvalIT.java │ │ ├── KMeansHyperParamTuningIT.java │ │ ├── KMeansUpdateIT.java │ │ └── RandomKMeansDataGenerator.java │ │ └── rdf │ │ ├── AbstractRDFIT.java │ │ ├── RDFCategoricalHyperParamTuningIT.java │ │ ├── RDFNumericHyperParamTuningIT.java │ │ ├── RDFUpdateIT.java │ │ ├── RandomCategoricalRDFDataGenerator.java │ │ └── RandomNumericRDFDataGenerator.java ├── oryx-app-serving │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cloudera │ │ │ │ └── oryx │ │ │ │ └── app │ │ │ │ └── serving │ │ │ │ ├── AbstractConsoleResource.java │ │ │ │ ├── AbstractOryxResource.java │ │ │ │ ├── FileItemPart.java │ │ │ │ ├── IDCount.java │ │ │ │ ├── IDEntity.java │ │ │ │ ├── IDValue.java │ │ │ │ ├── Ready.java │ │ │ │ ├── als │ │ │ │ ├── AbstractALSResource.java │ │ │ │ ├── AllItemIDs.java │ │ │ │ ├── AllUserIDs.java │ │ │ │ ├── Because.java │ │ │ │ ├── Console.java │ │ │ │ ├── CosineAverageFunction.java │ │ │ │ ├── CosineDistanceSensitiveFunction.java │ │ │ │ ├── DotsFunction.java │ │ │ │ ├── Estimate.java │ │ │ │ ├── EstimateForAnonymous.java │ │ │ │ ├── Ingest.java │ │ │ │ ├── KnownItems.java │ │ │ │ ├── MostActiveUsers.java │ │ │ │ ├── MostPopularItems.java │ │ │ │ ├── MostSurprising.java │ │ │ │ ├── PopularRepresentativeItems.java │ │ │ │ ├── Preference.java │ │ │ │ ├── Recommend.java │ │ │ │ ├── RecommendToAnonymous.java │ │ │ │ ├── RecommendToMany.java │ │ │ │ ├── RecommendWithContext.java │ │ │ │ ├── Similarity.java │ │ │ │ ├── SimilarityToItem.java │ │ │ │ ├── model │ │ │ │ │ ├── ALSServingModel.java │ │ │ │ │ ├── ALSServingModelManager.java │ │ │ │ │ ├── LocalitySensitiveHash.java │ │ │ │ │ ├── TopNConsumer.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ │ ├── classreg │ │ │ │ ├── Predict.java │ │ │ │ ├── Train.java │ │ │ │ ├── model │ │ │ │ │ └── ClassificationRegressionServingModel.java │ │ │ │ └── package-info.java │ │ │ │ ├── clustering │ │ │ │ ├── Add.java │ │ │ │ ├── Assign.java │ │ │ │ └── model │ │ │ │ │ ├── ClusteringServingModel.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── kmeans │ │ │ │ ├── Console.java │ │ │ │ ├── DistanceToNearest.java │ │ │ │ ├── model │ │ │ │ │ ├── KMeansServingModel.java │ │ │ │ │ ├── KMeansServingModelManager.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ └── rdf │ │ │ │ ├── ClassificationDistribution.java │ │ │ │ ├── Console.java │ │ │ │ ├── FeatureImportance.java │ │ │ │ ├── model │ │ │ │ ├── RDFServingModel.java │ │ │ │ ├── RDFServingModelManager.java │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ └── resources │ │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── app │ │ │ └── serving │ │ │ ├── als │ │ │ └── als.html.fragment │ │ │ ├── console-footer.html.fragment │ │ │ ├── console-header.html.fragment │ │ │ ├── kmeans │ │ │ └── kmeans.html.fragment │ │ │ └── rdf │ │ │ └── rdf.html.fragment │ │ └── test │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── app │ │ ├── serving │ │ ├── als │ │ │ ├── AbstractALSServingTest.java │ │ │ ├── AllItemIDsTest.java │ │ │ ├── AllUserIDsTest.java │ │ │ ├── BecauseTest.java │ │ │ ├── CompressedResponseTest.java │ │ │ ├── ConsoleTest.java │ │ │ ├── EstimateForAnonymousTest.java │ │ │ ├── EstimateTest.java │ │ │ ├── IngestTest.java │ │ │ ├── KnownItemsTest.java │ │ │ ├── LoadBenchmark.java │ │ │ ├── MostActiveUsersTest.java │ │ │ ├── MostPopularItemsTest.java │ │ │ ├── MostSurprisingTest.java │ │ │ ├── PopularRepresentativeItemsTest.java │ │ │ ├── PreferenceTest.java │ │ │ ├── ReadOnlyTest.java │ │ │ ├── ReadyTest.java │ │ │ ├── RecommendTest.java │ │ │ ├── RecommendToAnonymousTest.java │ │ │ ├── RecommendToManyTest.java │ │ │ ├── RecommendWithContextTest.java │ │ │ ├── SimilarityTest.java │ │ │ ├── SimilarityToItemTest.java │ │ │ ├── TestALSRescorerProvider.java │ │ │ └── model │ │ │ │ ├── ALSServingInputProducerIT.java │ │ │ │ ├── ALSServingModelManagerIT.java │ │ │ │ ├── ALSServingModelManagerTest.java │ │ │ │ ├── ALSServingModelTest.java │ │ │ │ ├── LoadTestALSModelFactory.java │ │ │ │ ├── LocalitySensitiveHashTest.java │ │ │ │ ├── NullProvider2.java │ │ │ │ ├── TestALSModelFactory.java │ │ │ │ └── TopNConsumerTest.java │ │ ├── kmeans │ │ │ ├── AbstractKMeansServingTest.java │ │ │ ├── AddTest.java │ │ │ ├── AssignTest.java │ │ │ ├── ConsoleTest.java │ │ │ ├── DistanceToNearestTest.java │ │ │ ├── ReadOnlyTest.java │ │ │ ├── ReadyTest.java │ │ │ └── model │ │ │ │ ├── KMeansServingModelManagerIT.java │ │ │ │ └── TestKMeansModelFactory.java │ │ └── rdf │ │ │ ├── AbstractRDFServingTest.java │ │ │ ├── ClassificationDistributionTest.java │ │ │ ├── ConsoleTest.java │ │ │ ├── FeatureImportanceTest.java │ │ │ ├── PredictTest.java │ │ │ ├── ReadOnlyTest.java │ │ │ ├── ReadyTest.java │ │ │ ├── TrainTest.java │ │ │ └── model │ │ │ ├── RDFServingModelManagerIT.java │ │ │ ├── TestRDFClassificationModelFactory.java │ │ │ └── TestRDFRegressionModelFactory.java │ │ └── traffic │ │ ├── Endpoint.java │ │ ├── Endpoints.java │ │ ├── TrafficUtil.java │ │ └── als │ │ └── ALSEndpoint.java └── oryx-app │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── app │ │ └── speed │ │ ├── als │ │ ├── ALSSpeedModel.java │ │ ├── ALSSpeedModelManager.java │ │ ├── UserItemStrength.java │ │ └── package-info.java │ │ ├── kmeans │ │ ├── KMeansSpeedModel.java │ │ ├── KMeansSpeedModelManager.java │ │ └── package-info.java │ │ └── rdf │ │ ├── RDFSpeedModel.java │ │ ├── RDFSpeedModelManager.java │ │ └── package-info.java │ └── test │ └── java │ └── com │ └── cloudera │ └── oryx │ └── app │ └── speed │ ├── als │ ├── ALSSpeedIT.java │ ├── ALSSpeedModelTest.java │ ├── MockALSInputGenerator.java │ └── MockALSModelUpdateGenerator.java │ ├── kmeans │ ├── KMeansSpeedIT.java │ ├── KMeansSpeedModelTest.java │ ├── MockKMeansInputGenerator.java │ └── MockKMeansModelGenerator.java │ └── rdf │ ├── MockRDFClassificationInputGenerator.java │ ├── MockRDFClassificationModelGenerator.java │ ├── MockRDFRegressionInputGenerator.java │ ├── MockRDFRegressionModelGenerator.java │ └── RDFSpeedIT.java ├── deploy ├── bin │ ├── compute-classpath.sh │ └── oryx-run.sh ├── oryx-batch │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── batch │ │ ├── Main.java │ │ └── package-info.java ├── oryx-serving │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── serving │ │ ├── Main.java │ │ └── package-info.java └── oryx-speed │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── cloudera │ └── oryx │ └── speed │ ├── Main.java │ └── package-info.java ├── docs ├── CNAME ├── apidocs │ ├── allclasses-frame.html │ ├── allclasses-noframe.html │ ├── com │ │ └── cloudera │ │ │ └── oryx │ │ │ ├── api │ │ │ ├── KeyMessage.html │ │ │ ├── KeyMessageImpl.html │ │ │ ├── TopicProducer.html │ │ │ ├── batch │ │ │ │ ├── BatchLayerUpdate.html │ │ │ │ ├── class-use │ │ │ │ │ └── BatchLayerUpdate.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── class-use │ │ │ │ ├── KeyMessage.html │ │ │ │ ├── KeyMessageImpl.html │ │ │ │ └── TopicProducer.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── package-use.html │ │ │ ├── serving │ │ │ │ ├── AbstractServingModelManager.html │ │ │ │ ├── HasCSV.html │ │ │ │ ├── OryxResource.html │ │ │ │ ├── OryxServingException.html │ │ │ │ ├── ServingModel.html │ │ │ │ ├── ServingModelManager.html │ │ │ │ ├── class-use │ │ │ │ │ ├── AbstractServingModelManager.html │ │ │ │ │ ├── HasCSV.html │ │ │ │ │ ├── OryxResource.html │ │ │ │ │ ├── OryxServingException.html │ │ │ │ │ ├── ServingModel.html │ │ │ │ │ └── ServingModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ └── speed │ │ │ │ ├── AbstractSpeedModelManager.html │ │ │ │ ├── SpeedModel.html │ │ │ │ ├── SpeedModelManager.html │ │ │ │ ├── class-use │ │ │ │ ├── AbstractSpeedModelManager.html │ │ │ │ ├── SpeedModel.html │ │ │ │ └── SpeedModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── app │ │ │ ├── als │ │ │ │ ├── ALSUtils.html │ │ │ │ ├── AbstractRescorerProvider.html │ │ │ │ ├── FeatureVectors.html │ │ │ │ ├── FeatureVectorsPartition.html │ │ │ │ ├── MultiRescorer.html │ │ │ │ ├── MultiRescorerProvider.html │ │ │ │ ├── PartitionedFeatureVectors.html │ │ │ │ ├── Rescorer.html │ │ │ │ ├── RescorerProvider.html │ │ │ │ ├── SolverCache.html │ │ │ │ ├── class-use │ │ │ │ │ ├── ALSUtils.html │ │ │ │ │ ├── AbstractRescorerProvider.html │ │ │ │ │ ├── FeatureVectors.html │ │ │ │ │ ├── FeatureVectorsPartition.html │ │ │ │ │ ├── MultiRescorer.html │ │ │ │ │ ├── MultiRescorerProvider.html │ │ │ │ │ ├── PartitionedFeatureVectors.html │ │ │ │ │ ├── Rescorer.html │ │ │ │ │ ├── RescorerProvider.html │ │ │ │ │ └── SolverCache.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── batch │ │ │ │ └── mllib │ │ │ │ │ ├── als │ │ │ │ │ ├── ALSUpdate.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ └── ALSUpdate.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── kmeans │ │ │ │ │ ├── KMeansEvalStrategy.html │ │ │ │ │ ├── KMeansUpdate.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── KMeansEvalStrategy.html │ │ │ │ │ │ └── KMeansUpdate.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ │ └── rdf │ │ │ │ │ ├── RDFUpdate.html │ │ │ │ │ ├── class-use │ │ │ │ │ └── RDFUpdate.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ ├── classreg │ │ │ │ ├── example │ │ │ │ │ ├── CategoricalFeature.html │ │ │ │ │ ├── Example.html │ │ │ │ │ ├── ExampleUtils.html │ │ │ │ │ ├── Feature.html │ │ │ │ │ ├── FeatureType.html │ │ │ │ │ ├── NumericFeature.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── CategoricalFeature.html │ │ │ │ │ │ ├── Example.html │ │ │ │ │ │ ├── ExampleUtils.html │ │ │ │ │ │ ├── Feature.html │ │ │ │ │ │ ├── FeatureType.html │ │ │ │ │ │ └── NumericFeature.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ └── predict │ │ │ │ │ ├── CategoricalPrediction.html │ │ │ │ │ ├── NumericPrediction.html │ │ │ │ │ ├── Prediction.html │ │ │ │ │ ├── WeightedPrediction.html │ │ │ │ │ ├── class-use │ │ │ │ │ ├── CategoricalPrediction.html │ │ │ │ │ ├── NumericPrediction.html │ │ │ │ │ ├── Prediction.html │ │ │ │ │ └── WeightedPrediction.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ ├── common │ │ │ │ └── fn │ │ │ │ │ ├── MLFunctions.html │ │ │ │ │ ├── class-use │ │ │ │ │ └── MLFunctions.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ ├── kmeans │ │ │ │ ├── ClusterInfo.html │ │ │ │ ├── DistanceFn.html │ │ │ │ ├── EuclideanDistanceFn.html │ │ │ │ ├── KMeansPMMLUtils.html │ │ │ │ ├── KMeansUtils.html │ │ │ │ ├── class-use │ │ │ │ │ ├── ClusterInfo.html │ │ │ │ │ ├── DistanceFn.html │ │ │ │ │ ├── EuclideanDistanceFn.html │ │ │ │ │ ├── KMeansPMMLUtils.html │ │ │ │ │ └── KMeansUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── pmml │ │ │ │ ├── AppPMMLUtils.html │ │ │ │ ├── class-use │ │ │ │ │ └── AppPMMLUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── rdf │ │ │ │ ├── RDFPMMLUtils.html │ │ │ │ ├── class-use │ │ │ │ │ └── RDFPMMLUtils.html │ │ │ │ ├── decision │ │ │ │ │ ├── CategoricalDecision.html │ │ │ │ │ ├── Decision.html │ │ │ │ │ ├── NumericDecision.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── CategoricalDecision.html │ │ │ │ │ │ ├── Decision.html │ │ │ │ │ │ └── NumericDecision.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ ├── package-use.html │ │ │ │ └── tree │ │ │ │ │ ├── DecisionForest.html │ │ │ │ │ ├── DecisionNode.html │ │ │ │ │ ├── DecisionTree.html │ │ │ │ │ ├── TerminalNode.html │ │ │ │ │ ├── TreeBasedClassifier.html │ │ │ │ │ ├── TreeNode.html │ │ │ │ │ ├── class-use │ │ │ │ │ ├── DecisionForest.html │ │ │ │ │ ├── DecisionNode.html │ │ │ │ │ ├── DecisionTree.html │ │ │ │ │ ├── TerminalNode.html │ │ │ │ │ ├── TreeBasedClassifier.html │ │ │ │ │ └── TreeNode.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ ├── schema │ │ │ │ ├── CategoricalValueEncodings.html │ │ │ │ ├── InputSchema.html │ │ │ │ ├── class-use │ │ │ │ │ ├── CategoricalValueEncodings.html │ │ │ │ │ └── InputSchema.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── serving │ │ │ │ ├── AbstractConsoleResource.html │ │ │ │ ├── AbstractOryxResource.html │ │ │ │ ├── IDCount.html │ │ │ │ ├── IDValue.html │ │ │ │ ├── Ready.html │ │ │ │ ├── als │ │ │ │ │ ├── AllItemIDs.html │ │ │ │ │ ├── AllUserIDs.html │ │ │ │ │ ├── Because.html │ │ │ │ │ ├── Console.html │ │ │ │ │ ├── CosineAverageFunction.html │ │ │ │ │ ├── CosineDistanceSensitiveFunction.html │ │ │ │ │ ├── DotsFunction.html │ │ │ │ │ ├── Estimate.html │ │ │ │ │ ├── EstimateForAnonymous.html │ │ │ │ │ ├── Ingest.html │ │ │ │ │ ├── KnownItems.html │ │ │ │ │ ├── MostActiveUsers.html │ │ │ │ │ ├── MostPopularItems.html │ │ │ │ │ ├── MostSurprising.html │ │ │ │ │ ├── PopularRepresentativeItems.html │ │ │ │ │ ├── Preference.html │ │ │ │ │ ├── Recommend.html │ │ │ │ │ ├── RecommendToAnonymous.html │ │ │ │ │ ├── RecommendToMany.html │ │ │ │ │ ├── RecommendWithContext.html │ │ │ │ │ ├── Similarity.html │ │ │ │ │ ├── SimilarityToItem.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── AllItemIDs.html │ │ │ │ │ │ ├── AllUserIDs.html │ │ │ │ │ │ ├── Because.html │ │ │ │ │ │ ├── Console.html │ │ │ │ │ │ ├── CosineAverageFunction.html │ │ │ │ │ │ ├── CosineDistanceSensitiveFunction.html │ │ │ │ │ │ ├── DotsFunction.html │ │ │ │ │ │ ├── Estimate.html │ │ │ │ │ │ ├── EstimateForAnonymous.html │ │ │ │ │ │ ├── Ingest.html │ │ │ │ │ │ ├── KnownItems.html │ │ │ │ │ │ ├── MostActiveUsers.html │ │ │ │ │ │ ├── MostPopularItems.html │ │ │ │ │ │ ├── MostSurprising.html │ │ │ │ │ │ ├── PopularRepresentativeItems.html │ │ │ │ │ │ ├── Preference.html │ │ │ │ │ │ ├── Recommend.html │ │ │ │ │ │ ├── RecommendToAnonymous.html │ │ │ │ │ │ ├── RecommendToMany.html │ │ │ │ │ │ ├── RecommendWithContext.html │ │ │ │ │ │ ├── Similarity.html │ │ │ │ │ │ └── SimilarityToItem.html │ │ │ │ │ ├── model │ │ │ │ │ │ ├── ALSServingModel.html │ │ │ │ │ │ ├── ALSServingModelManager.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ ├── ALSServingModel.html │ │ │ │ │ │ │ └── ALSServingModelManager.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ ├── class-use │ │ │ │ │ ├── AbstractConsoleResource.html │ │ │ │ │ ├── AbstractOryxResource.html │ │ │ │ │ ├── IDCount.html │ │ │ │ │ ├── IDValue.html │ │ │ │ │ └── Ready.html │ │ │ │ ├── classreg │ │ │ │ │ ├── Predict.html │ │ │ │ │ ├── Train.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── Predict.html │ │ │ │ │ │ └── Train.html │ │ │ │ │ ├── model │ │ │ │ │ │ ├── ClassificationRegressionServingModel.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── ClassificationRegressionServingModel.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ ├── clustering │ │ │ │ │ ├── Add.html │ │ │ │ │ ├── Assign.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── Add.html │ │ │ │ │ │ └── Assign.html │ │ │ │ │ ├── model │ │ │ │ │ │ ├── ClusteringServingModel.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── ClusteringServingModel.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ ├── kmeans │ │ │ │ │ ├── Console.html │ │ │ │ │ ├── DistanceToNearest.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── Console.html │ │ │ │ │ │ └── DistanceToNearest.html │ │ │ │ │ ├── model │ │ │ │ │ │ ├── KMeansServingModel.html │ │ │ │ │ │ ├── KMeansServingModelManager.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ ├── KMeansServingModel.html │ │ │ │ │ │ │ └── KMeansServingModelManager.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ ├── package-use.html │ │ │ │ └── rdf │ │ │ │ │ ├── ClassificationDistribution.html │ │ │ │ │ ├── Console.html │ │ │ │ │ ├── FeatureImportance.html │ │ │ │ │ ├── class-use │ │ │ │ │ ├── ClassificationDistribution.html │ │ │ │ │ ├── Console.html │ │ │ │ │ └── FeatureImportance.html │ │ │ │ │ ├── model │ │ │ │ │ ├── RDFServingModel.html │ │ │ │ │ ├── RDFServingModelManager.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── RDFServingModel.html │ │ │ │ │ │ └── RDFServingModelManager.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ └── package-use.html │ │ │ └── speed │ │ │ │ ├── als │ │ │ │ ├── ALSSpeedModel.html │ │ │ │ ├── ALSSpeedModelManager.html │ │ │ │ ├── class-use │ │ │ │ │ ├── ALSSpeedModel.html │ │ │ │ │ └── ALSSpeedModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ │ ├── kmeans │ │ │ │ ├── KMeansSpeedModel.html │ │ │ │ ├── KMeansSpeedModelManager.html │ │ │ │ ├── class-use │ │ │ │ │ ├── KMeansSpeedModel.html │ │ │ │ │ └── KMeansSpeedModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ │ └── rdf │ │ │ │ ├── RDFSpeedModel.html │ │ │ │ ├── RDFSpeedModelManager.html │ │ │ │ ├── class-use │ │ │ │ ├── RDFSpeedModel.html │ │ │ │ └── RDFSpeedModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── batch │ │ │ ├── Main.html │ │ │ ├── class-use │ │ │ │ └── Main.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ │ ├── common │ │ │ ├── collection │ │ │ │ ├── CloseableIterator.html │ │ │ │ ├── Pair.html │ │ │ │ ├── Pairs.SortOrder.html │ │ │ │ ├── Pairs.html │ │ │ │ ├── class-use │ │ │ │ │ ├── CloseableIterator.html │ │ │ │ │ ├── Pair.html │ │ │ │ │ ├── Pairs.SortOrder.html │ │ │ │ │ └── Pairs.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── io │ │ │ │ ├── IOUtils.html │ │ │ │ ├── class-use │ │ │ │ │ └── IOUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── lang │ │ │ │ ├── AutoLock.html │ │ │ │ ├── AutoReadWriteLock.html │ │ │ │ ├── ClassUtils.html │ │ │ │ ├── ExecUtils.html │ │ │ │ ├── JVMUtils.html │ │ │ │ ├── LoggingCallable.AllowExceptionSupplier.html │ │ │ │ ├── LoggingCallable.html │ │ │ │ ├── OryxShutdownHook.html │ │ │ │ ├── RateLimitCheck.html │ │ │ │ ├── ToDoubleObjDoubleBiFunction.html │ │ │ │ ├── class-use │ │ │ │ │ ├── AutoLock.html │ │ │ │ │ ├── AutoReadWriteLock.html │ │ │ │ │ ├── ClassUtils.html │ │ │ │ │ ├── ExecUtils.html │ │ │ │ │ ├── JVMUtils.html │ │ │ │ │ ├── LoggingCallable.AllowExceptionSupplier.html │ │ │ │ │ ├── LoggingCallable.html │ │ │ │ │ ├── OryxShutdownHook.html │ │ │ │ │ ├── RateLimitCheck.html │ │ │ │ │ └── ToDoubleObjDoubleBiFunction.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── math │ │ │ │ ├── DoubleWeightedMean.html │ │ │ │ ├── LinearSystemSolver.html │ │ │ │ ├── SingularMatrixSolverException.html │ │ │ │ ├── Solver.html │ │ │ │ ├── VectorMath.html │ │ │ │ ├── class-use │ │ │ │ │ ├── DoubleWeightedMean.html │ │ │ │ │ ├── LinearSystemSolver.html │ │ │ │ │ ├── SingularMatrixSolverException.html │ │ │ │ │ ├── Solver.html │ │ │ │ │ └── VectorMath.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── package-use.html │ │ │ ├── pmml │ │ │ │ ├── PMMLUtils.html │ │ │ │ ├── class-use │ │ │ │ │ └── PMMLUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── random │ │ │ │ ├── RandomManager.html │ │ │ │ ├── class-use │ │ │ │ │ └── RandomManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── settings │ │ │ │ ├── ConfigToProperties.html │ │ │ │ ├── ConfigUtils.html │ │ │ │ ├── class-use │ │ │ │ │ ├── ConfigToProperties.html │ │ │ │ │ └── ConfigUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ └── text │ │ │ │ ├── TextUtils.html │ │ │ │ ├── class-use │ │ │ │ └── TextUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── example │ │ │ ├── batch │ │ │ │ ├── ExampleBatchLayerUpdate.html │ │ │ │ ├── class-use │ │ │ │ │ └── ExampleBatchLayerUpdate.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── serving │ │ │ │ ├── Add.html │ │ │ │ ├── Distinct.html │ │ │ │ ├── ExampleServingModel.html │ │ │ │ ├── ExampleServingModelManager.html │ │ │ │ ├── class-use │ │ │ │ │ ├── Add.html │ │ │ │ │ ├── Distinct.html │ │ │ │ │ ├── ExampleServingModel.html │ │ │ │ │ └── ExampleServingModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ └── speed │ │ │ │ ├── ExampleSpeedModelManager.html │ │ │ │ ├── class-use │ │ │ │ └── ExampleSpeedModelManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── kafka │ │ │ └── util │ │ │ │ ├── ConsumeDataIterator.html │ │ │ │ ├── KafkaUtils.html │ │ │ │ ├── class-use │ │ │ │ ├── ConsumeDataIterator.html │ │ │ │ └── KafkaUtils.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── lambda │ │ │ ├── AbstractSparkLayer.html │ │ │ ├── DeleteOldDataFn.html │ │ │ ├── HadoopUtils.html │ │ │ ├── TopicProducerImpl.html │ │ │ ├── UpdateOffsetsFn.html │ │ │ ├── batch │ │ │ │ ├── BatchLayer.html │ │ │ │ ├── ScalaBatchLayerUpdateAdapter.html │ │ │ │ ├── class-use │ │ │ │ │ ├── BatchLayer.html │ │ │ │ │ └── ScalaBatchLayerUpdateAdapter.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── class-use │ │ │ │ ├── AbstractSparkLayer.html │ │ │ │ ├── DeleteOldDataFn.html │ │ │ │ ├── HadoopUtils.html │ │ │ │ ├── TopicProducerImpl.html │ │ │ │ └── UpdateOffsetsFn.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── package-use.html │ │ │ ├── serving │ │ │ │ ├── CSVMessageBodyWriter.html │ │ │ │ ├── ErrorResource.html │ │ │ │ ├── InMemoryRealm.html │ │ │ │ ├── ModelManagerListener.html │ │ │ │ ├── OryxApplication.html │ │ │ │ ├── OryxExceptionMapper.html │ │ │ │ ├── ScalaServingModelManagerAdapter.html │ │ │ │ ├── ServingLayer.html │ │ │ │ ├── TopicProducerImpl.html │ │ │ │ ├── class-use │ │ │ │ │ ├── CSVMessageBodyWriter.html │ │ │ │ │ ├── ErrorResource.html │ │ │ │ │ ├── InMemoryRealm.html │ │ │ │ │ ├── ModelManagerListener.html │ │ │ │ │ ├── OryxApplication.html │ │ │ │ │ ├── OryxExceptionMapper.html │ │ │ │ │ ├── ScalaServingModelManagerAdapter.html │ │ │ │ │ ├── ServingLayer.html │ │ │ │ │ └── TopicProducerImpl.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ └── speed │ │ │ │ ├── ScalaSpeedModelManagerAdapter.html │ │ │ │ ├── SpeedLayer.html │ │ │ │ ├── class-use │ │ │ │ ├── ScalaSpeedModelManagerAdapter.html │ │ │ │ └── SpeedLayer.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── ml │ │ │ ├── MLUpdate.html │ │ │ ├── class-use │ │ │ │ └── MLUpdate.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── package-use.html │ │ │ └── param │ │ │ │ ├── HyperParamValues.html │ │ │ │ ├── HyperParams.html │ │ │ │ ├── class-use │ │ │ │ ├── HyperParamValues.html │ │ │ │ └── HyperParams.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── serving │ │ │ ├── Main.html │ │ │ ├── class-use │ │ │ │ └── Main.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ │ └── speed │ │ │ ├── Main.html │ │ │ ├── class-use │ │ │ └── Main.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ ├── constant-values.html │ ├── deprecated-list.html │ ├── help-doc.html │ ├── index-all.html │ ├── index.html │ ├── overview-frame.html │ ├── overview-summary.html │ ├── overview-tree.html │ ├── package-list │ ├── script.js │ ├── serialized-form.html │ └── stylesheet.css ├── css │ ├── bootswatch.css │ ├── docs.css │ ├── lightbox.css │ ├── print.css │ ├── reflow-skin.css │ └── site.css ├── docs │ ├── admin.html │ ├── developer.html │ ├── endusers.html │ ├── how-to-release.html │ └── performance.html ├── img │ ├── Architecture.png │ ├── OryxLogoMedium.png │ ├── OryxLogoSmall.png │ ├── close.png │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ ├── loading.gif │ ├── next.png │ └── prev.png ├── index.html ├── js │ ├── lightbox.min.js │ ├── reflow-scroll.js │ └── reflow-skin.js └── project-reports.html ├── framework ├── kafka-util │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── kafka │ │ │ └── util │ │ │ ├── ConsumeDataIterator.java │ │ │ ├── KafkaUtils.java │ │ │ └── package-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── kafka │ │ └── util │ │ ├── ConsumeData.java │ │ ├── ConsumeTopicRunnable.java │ │ ├── DatumGenerator.java │ │ ├── DefaultCSVDatumGenerator.java │ │ ├── LargeMessageIT.java │ │ ├── LocalKafkaBroker.java │ │ ├── LocalZKServer.java │ │ ├── ProduceConsumeIT.java │ │ └── ProduceData.java ├── oryx-api │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── api │ │ │ ├── KeyMessage.java │ │ │ ├── KeyMessageImpl.java │ │ │ ├── TopicProducer.java │ │ │ ├── batch │ │ │ ├── BatchLayerUpdate.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── serving │ │ │ ├── AbstractServingModelManager.java │ │ │ ├── HasCSV.java │ │ │ ├── OryxResource.java │ │ │ ├── OryxServingException.java │ │ │ ├── ServingModel.java │ │ │ ├── ServingModelManager.java │ │ │ └── package-info.java │ │ │ └── speed │ │ │ ├── AbstractSpeedModelManager.java │ │ │ ├── SpeedModel.java │ │ │ ├── SpeedModelManager.java │ │ │ └── package-info.java │ │ └── scala │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── api │ │ ├── batch │ │ └── ScalaBatchLayerUpdate.scala │ │ ├── serving │ │ ├── AbstractScalaServingModelManager.scala │ │ └── ScalaServingModelManager.scala │ │ └── speed │ │ ├── AbstractScalaSpeedModelManager.scala │ │ └── ScalaSpeedModelManager.scala ├── oryx-common │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cloudera │ │ │ │ └── oryx │ │ │ │ └── common │ │ │ │ ├── collection │ │ │ │ ├── CloseableIterator.java │ │ │ │ ├── Pair.java │ │ │ │ ├── Pairs.java │ │ │ │ └── package-info.java │ │ │ │ ├── io │ │ │ │ ├── IOUtils.java │ │ │ │ └── package-info.java │ │ │ │ ├── lang │ │ │ │ ├── AutoLock.java │ │ │ │ ├── AutoReadWriteLock.java │ │ │ │ ├── ClassUtils.java │ │ │ │ ├── ExecUtils.java │ │ │ │ ├── JVMUtils.java │ │ │ │ ├── LoggingCallable.java │ │ │ │ ├── OryxShutdownHook.java │ │ │ │ ├── RateLimitCheck.java │ │ │ │ ├── ToDoubleObjDoubleBiFunction.java │ │ │ │ └── package-info.java │ │ │ │ ├── math │ │ │ │ ├── DoubleWeightedMean.java │ │ │ │ ├── LinearSystemSolver.java │ │ │ │ ├── SingularMatrixSolverException.java │ │ │ │ ├── Solver.java │ │ │ │ ├── VectorMath.java │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ ├── pmml │ │ │ │ ├── PMMLUtils.java │ │ │ │ └── package-info.java │ │ │ │ ├── random │ │ │ │ ├── RandomManager.java │ │ │ │ └── package-info.java │ │ │ │ ├── settings │ │ │ │ ├── ConfigToProperties.java │ │ │ │ ├── ConfigUtils.java │ │ │ │ └── package-info.java │ │ │ │ └── text │ │ │ │ ├── TextUtils.java │ │ │ │ └── package-info.java │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── reference.conf │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── common │ │ │ ├── OryxTest.java │ │ │ ├── collection │ │ │ ├── PairTest.java │ │ │ └── PairsTest.java │ │ │ ├── io │ │ │ └── IOUtilsTest.java │ │ │ ├── lang │ │ │ ├── AutoLockTest.java │ │ │ ├── AutoReadWriteLockTest.java │ │ │ ├── ClassUtilsTest.java │ │ │ ├── ExecUtilsTest.java │ │ │ ├── JVMUtilsTest.java │ │ │ ├── LoggingTest.java │ │ │ └── RateLimitCheckTest.java │ │ │ ├── math │ │ │ ├── DoubleWeightedMeanTest.java │ │ │ ├── LinearSystemSolverTest.java │ │ │ └── VectorMathTest.java │ │ │ ├── pmml │ │ │ └── PMMLUtilsTest.java │ │ │ ├── random │ │ │ ├── RandomManagerRandomTest.java │ │ │ └── RandomManagerTest.java │ │ │ ├── settings │ │ │ ├── ConfigToPropertiesTest.java │ │ │ └── ConfigUtilsTest.java │ │ │ └── text │ │ │ └── TextUtilsTest.java │ │ └── resources │ │ └── log4j.test.properties ├── oryx-lambda-serving │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── lambda │ │ │ └── serving │ │ │ ├── CSVMessageBodyWriter.java │ │ │ ├── ErrorResource.java │ │ │ ├── InMemoryRealm.java │ │ │ ├── ModelManagerListener.java │ │ │ ├── OryxApplication.java │ │ │ ├── OryxExceptionMapper.java │ │ │ ├── ScalaServingModelManagerAdapter.java │ │ │ ├── ServingLayer.java │ │ │ ├── TopicProducerImpl.java │ │ │ └── package-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── lambda │ │ │ └── serving │ │ │ ├── AbstractServingIT.java │ │ │ ├── AbstractServingTest.java │ │ │ ├── CSVMessageBodyWriterTest.java │ │ │ ├── ErrorResourceTest.java │ │ │ ├── HelloWorld.java │ │ │ ├── InMemoryRealmTest.java │ │ │ ├── MockServingModelManager.java │ │ │ ├── MockTopicProducer.java │ │ │ ├── ModelManagerListenerIT.java │ │ │ ├── OryxExceptionMapperTest.java │ │ │ ├── SecureAPIConfigIT.java │ │ │ ├── ServingLayerTest.java │ │ │ └── TopicProducerImplTest.java │ │ └── resources │ │ └── oryxtest.jks ├── oryx-lambda │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── cloudera │ │ │ └── oryx │ │ │ └── lambda │ │ │ ├── AbstractSparkLayer.java │ │ │ ├── DeleteOldDataFn.java │ │ │ ├── HadoopUtils.java │ │ │ ├── TopicProducerImpl.java │ │ │ ├── UpdateOffsetsFn.java │ │ │ ├── batch │ │ │ ├── BatchLayer.java │ │ │ ├── BatchUpdateFunction.java │ │ │ ├── SaveToHDFSFunction.java │ │ │ ├── ScalaBatchLayerUpdateAdapter.java │ │ │ ├── ValueToWritableFunction.java │ │ │ ├── ValueWritableConverter.java │ │ │ ├── WritableToValueFunction.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── speed │ │ │ ├── ScalaSpeedModelManagerAdapter.java │ │ │ ├── SpeedLayer.java │ │ │ ├── SpeedLayerUpdate.java │ │ │ └── package-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── lambda │ │ ├── AbstractLambdaIT.java │ │ ├── AbstractSparkIT.java │ │ ├── HadoopUtilsTest.java │ │ ├── TopicProducerImplTest.java │ │ ├── batch │ │ ├── AbstractBatchIT.java │ │ ├── BatchLayerIT.java │ │ ├── DeleteOldDataIT.java │ │ ├── IntervalData.java │ │ ├── MockBatchUpdate.java │ │ ├── ValueToWritableFunctionTest.java │ │ ├── ValueWritableConverterTest.java │ │ └── WritableToValueFunctionTest.java │ │ └── speed │ │ ├── AbstractSpeedIT.java │ │ ├── MockModelGenerator.java │ │ ├── MockSpeedModelManager.java │ │ └── SpeedLayerIT.java └── oryx-ml │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── cloudera │ │ └── oryx │ │ └── ml │ │ ├── MLUpdate.java │ │ ├── package-info.java │ │ └── param │ │ ├── ContinuousAround.java │ │ ├── ContinuousRange.java │ │ ├── DiscreteAround.java │ │ ├── DiscreteRange.java │ │ ├── GridSearch.java │ │ ├── HyperParamValues.java │ │ ├── HyperParams.java │ │ ├── RandomSearch.java │ │ ├── Unordered.java │ │ └── package-info.java │ └── test │ └── java │ └── com │ └── cloudera │ └── oryx │ └── ml │ ├── MockMLUpdate.java │ ├── SimpleMLUpdateIT.java │ ├── ThresholdIT.java │ └── param │ ├── GridSearchTest.java │ ├── HyperParamsTest.java │ └── RandomSearchTest.java ├── pom.xml └── src ├── checkstyle └── checkstyle.xml └── site ├── markdown ├── docs │ ├── admin.md │ ├── developer.md │ ├── endusers.md │ ├── how-to-release.md │ └── performance.md └── index.md ├── resources └── img │ ├── Architecture.png │ ├── OryxLogoMedium.png │ └── OryxLogoSmall.png └── site.xml /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributions via GitHub pull requests are gladly accepted from their original author. 2 | Along with any pull requests, please state that the contribution is your original work 3 | and that you license the work to the project under the project's open source license. 4 | Whether or not you state this explicitly, by submitting any copyrighted material via pull 5 | request, email, or other means you agree to license the material under the project's open 6 | source license and warrant that you have the legal authority to do so. 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Have a question? ask at https://groups.google.com/a/cloudera.org/forum/#!forum/oryx-user instead! 2 | 3 | Have a look at the "guidelines for contributing" link above. 4 | 5 | Please provide basic information like version of Oryx, how you ran the binaries, error messages 6 | of any kind, and relevant parts of the configuration file. 7 | 8 | Delete this text. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Have a question? ask at https://groups.google.com/a/cloudera.org/forum/#!forum/oryx-user instead! 2 | 3 | Have a look at the "guidelines for contributing" link above. 4 | 5 | Delete this text. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .checkstyle 3 | .classpath 4 | .project 5 | .settings/ 6 | .idea/ 7 | target/ 8 | pom.xml.tag 9 | pom.xml.releaseBackup 10 | pom.xml.next 11 | release.properties 12 | dependency-reduced-pom.xml 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | os: linux 3 | dist: bionic 4 | jdk: openjdk8 5 | install: mvn ${SPARK} -Ptravis -Pnetlib -DskipTests=true -nsu -B install 6 | script: 7 | - mvn ${SPARK} ${JACOCO} -Ptravis -Pnetlib -q -nsu -B verify 8 | - find $HOME/.m2/repository/com/cloudera/oryx -path "*SNAPSHOT/*" -delete 9 | - find $HOME/.m2/repository/com/cloudera/oryx -name "*SNAPSHOT" -type d -delete 10 | env: JACOCO=-Pjacoco 11 | cache: 12 | directories: 13 | - $HOME/.m2 14 | git: 15 | depth: 10 16 | after_success: if [ -n "$JACOCO" ]; then bash <(curl -s https://codecov.io/bash); fi 17 | -------------------------------------------------------------------------------- /app/example/src/main/java/com/cloudera/oryx/example/batch/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains a minimal example of what a user application would create to implement a 18 | * Batch Layer. 19 | */ 20 | package com.cloudera.oryx.example.batch; -------------------------------------------------------------------------------- /app/example/src/main/java/com/cloudera/oryx/example/serving/ExampleServingModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.example.serving; 17 | 18 | import java.util.Map; 19 | 20 | import com.cloudera.oryx.api.serving.ServingModel; 21 | 22 | /** 23 | * {@link ServingModel} produced by {@link ExampleServingModelManager}. 24 | */ 25 | public final class ExampleServingModel implements ServingModel { 26 | 27 | private final Map distinctOtherWords; 28 | 29 | ExampleServingModel(Map distinctOtherWords) { 30 | this.distinctOtherWords = distinctOtherWords; 31 | } 32 | 33 | @Override 34 | public float getFractionLoaded() { 35 | return 1.0f; 36 | } 37 | 38 | public Map getWords() { 39 | return distinctOtherWords; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/example/src/main/java/com/cloudera/oryx/example/serving/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains a minimal example of what a user application would create to implement a 18 | * Serving Layer. 19 | */ 20 | package com.cloudera.oryx.example.serving; -------------------------------------------------------------------------------- /app/example/src/main/java/com/cloudera/oryx/example/speed/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains a minimal example of what a user application would create to implement a 18 | * Speed Layer. 19 | */ 20 | package com.cloudera.oryx.example.speed; -------------------------------------------------------------------------------- /app/oryx-app-api/src/main/java/com/cloudera/oryx/app/als/Rescorer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | /** 19 | * Implementations of this interface can "rescore" the recommender's score for a item that is a candidate for 20 | * recommendation. It can boost or demote an item given its ID, or filter it out entirely. 21 | * 22 | * @since 2.0.0 23 | */ 24 | public interface Rescorer { 25 | 26 | /** 27 | * @param id ID of item to rescore 28 | * @param originalScore original score from the recommender 29 | * @return new score; return {@link Double#NaN} to exclude the item from recommendation 30 | * @since 2.0.0 31 | */ 32 | double rescore(String id, double originalScore); 33 | 34 | /** 35 | * @param id of item to consider for filtering 36 | * @return true iff the item should be removed from consideration 37 | * @since 2.0.0 38 | */ 39 | boolean isFiltered(String id); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/oryx-app-api/src/test/java/com/cloudera/oryx/app/als/AbstractRescorerProviderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | public final class AbstractRescorerProviderTest extends OryxTest { 23 | 24 | @Test 25 | public void testDefault() { 26 | RescorerProvider noop = new NullProvider1(); 27 | assertNull(noop.getMostActiveUsersRescorer(null)); 28 | assertNull(noop.getMostPopularItemsRescorer(null)); 29 | assertNull(noop.getMostSimilarItemsRescorer(null)); 30 | assertNull(noop.getRecommendRescorer(null, null)); 31 | assertNull(noop.getRecommendToAnonymousRescorer(null, null)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/oryx-app-api/src/test/java/com/cloudera/oryx/app/als/ErrorProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | public final class ErrorProvider extends AbstractRescorerProvider { 19 | public ErrorProvider() { 20 | throw new IllegalStateException("test error"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/oryx-app-api/src/test/java/com/cloudera/oryx/app/als/MultiRescorerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | public final class MultiRescorerTest extends OryxTest { 23 | 24 | @Test 25 | public void testOf() { 26 | MultiRescorer multi = (MultiRescorer) MultiRescorer.of(new SimpleModRescorer(1), new SimpleModRescorer(2)); 27 | assertEquals(2, multi.getRescorers().length); 28 | MultiRescorer multi2 = (MultiRescorer) MultiRescorer.of(multi, new SimpleModRescorer(3)); 29 | assertEquals(3, multi2.getRescorers().length); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/oryx-app-api/src/test/java/com/cloudera/oryx/app/als/NullProvider1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | public final class NullProvider1 extends AbstractRescorerProvider { 19 | } 20 | -------------------------------------------------------------------------------- /app/oryx-app-api/src/test/java/com/cloudera/oryx/app/als/SimpleModRescorer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | final class SimpleModRescorer implements Rescorer { 19 | 20 | private final int modulus; 21 | 22 | SimpleModRescorer(int modulus) { 23 | this.modulus = modulus; 24 | } 25 | 26 | @Override 27 | public double rescore(String itemID, double value) { 28 | return isFiltered(itemID) ? Double.NaN : value; 29 | } 30 | 31 | @Override 32 | public boolean isFiltered(String itemID) { 33 | return itemID.length() % modulus != 0; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/als/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Support code for rALS recommender application functionality common to several layers. 18 | */ 19 | package com.cloudera.oryx.app.als; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/classreg/example/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.classreg.example; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * Implementations represent the value of one feature in an {@link Example}. 22 | * 23 | * @see NumericFeature 24 | * @see CategoricalFeature 25 | */ 26 | @FunctionalInterface 27 | public interface Feature extends Serializable { 28 | 29 | /** 30 | * @return type of the feature 31 | */ 32 | FeatureType getFeatureType(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/classreg/example/FeatureType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.classreg.example; 17 | 18 | /** 19 | * Represents the type of a {@link Feature}. 20 | */ 21 | public enum FeatureType { 22 | 23 | /** Numeric feature: real-valued, whether continuous or discrete. */ 24 | NUMERIC, 25 | 26 | /** 27 | * Categorical feature (a.k.a. nominal): taking on discrete unordered values like 28 | * {@code [male,female]}. 29 | */ 30 | CATEGORICAL, 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/classreg/example/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Representations of features and training / test examples that are used inside a 18 | * classification or regression process. 19 | */ 20 | package com.cloudera.oryx.app.classreg.example; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/classreg/predict/Prediction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.classreg.predict; 17 | 18 | import java.io.Serializable; 19 | 20 | import com.cloudera.oryx.app.classreg.example.Example; 21 | import com.cloudera.oryx.app.classreg.example.FeatureType; 22 | 23 | /** 24 | * Subclasses represent the predicted value of the target. 25 | * 26 | * @see NumericPrediction 27 | * @see CategoricalPrediction 28 | */ 29 | public abstract class Prediction implements Serializable { 30 | 31 | private volatile int count; 32 | 33 | Prediction(int initialCount) { 34 | this.count = initialCount; 35 | } 36 | 37 | public final int getCount() { 38 | return count; 39 | } 40 | 41 | final void setCount(int count) { 42 | this.count = count; 43 | } 44 | 45 | public abstract FeatureType getFeatureType(); 46 | 47 | public abstract void update(Example train); 48 | 49 | @Override 50 | public abstract String toString(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/classreg/predict/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Representations of the output of a classification or regression process. 18 | */ 19 | package com.cloudera.oryx.app.classreg.predict; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/common/fn/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains Java Functions useful across ML tier implementations. 18 | */ 19 | package com.cloudera.oryx.app.common.fn; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/kmeans/DistanceFn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. and Intel Corp. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.kmeans; 17 | 18 | import java.io.Serializable; 19 | import java.util.function.ToDoubleBiFunction; 20 | 21 | /** 22 | * A function that returns a distance between things. 23 | * 24 | * @param type of things to compare 25 | */ 26 | @FunctionalInterface 27 | public interface DistanceFn extends Serializable, ToDoubleBiFunction { 28 | // Adds no methods, just Serializable and specialization of bifunction 29 | } 30 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/kmeans/EuclideanDistanceFn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. and Intel Corp. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.kmeans; 17 | 18 | import com.google.common.base.Preconditions; 19 | 20 | /** 21 | * Returns the Euclidean distance between two {@code double[]}. 22 | */ 23 | public final class EuclideanDistanceFn implements DistanceFn { 24 | 25 | @Override 26 | public double applyAsDouble(double[] t1, double[] t2) { 27 | int length = t1.length; 28 | Preconditions.checkArgument(length == t2.length); 29 | double sumSq = 0.0; 30 | for (int i = 0; i < length; i++) { 31 | double diff = t1[i] - t2[i]; 32 | sumSq += diff * diff; 33 | } 34 | return Math.sqrt(sumSq); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/kmeans/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Support code for the k-means application functionality common to several layers. 18 | */ 19 | package com.cloudera.oryx.app.kmeans; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/pmml/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Utility code related to parsing, writing and manipulating PMML representations 18 | * of models, specific to applications. 19 | */ 20 | package com.cloudera.oryx.app.pmml; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/rdf/decision/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Supports decisions on features that are used inside a decision tree scoring process. 18 | */ 19 | package com.cloudera.oryx.app.rdf.decision; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/rdf/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Support code for random decision forest application functionality common to several layers, 18 | * mostly the scoring support. 19 | */ 20 | package com.cloudera.oryx.app.rdf; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/rdf/tree/TreeBasedClassifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.rdf.tree; 17 | 18 | import java.io.Serializable; 19 | 20 | import com.cloudera.oryx.app.classreg.predict.Prediction; 21 | import com.cloudera.oryx.app.classreg.example.Example; 22 | 23 | /** 24 | * Base interface for decision-tree-based classifiers in this package, whether they be a single 25 | * {@link DecisionTree} or a collection of them as a {@link DecisionForest}. 26 | */ 27 | public interface TreeBasedClassifier extends Serializable { 28 | 29 | /** 30 | * @param test example whose target value is to be predicated 31 | * @return a {@link Prediction} of the target value 32 | */ 33 | Prediction predict(Example test); 34 | 35 | /** 36 | * Requests that the implementation update its internal state to reflect a new {@link Example}. 37 | * In this case, the {@link Example} should carry a target value to learn from. 38 | * 39 | * @param train new training example 40 | */ 41 | void update(Example train); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/rdf/tree/TreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.rdf.tree; 17 | 18 | import java.io.Serializable; 19 | import java.util.Objects; 20 | 21 | /** 22 | * Implementations of this interface represent nodes in a {@link DecisionTree}, whether 23 | * leaves ({@link TerminalNode}) or internal nodes ({@link DecisionNode}). 24 | * 25 | * @see TerminalNode 26 | * @see DecisionNode 27 | */ 28 | public abstract class TreeNode implements Serializable { 29 | 30 | private final String id; 31 | 32 | TreeNode(String id) { 33 | Objects.requireNonNull(id); 34 | this.id = id; 35 | } 36 | 37 | /** 38 | * @return unique ID for this node (unique within its tree) 39 | */ 40 | public String getID() { 41 | return id; 42 | } 43 | 44 | /** 45 | * @return true iff the node is a leaf ({@link TerminalNode}) rather than a {@link DecisionNode} 46 | */ 47 | public abstract boolean isTerminal(); 48 | 49 | @Override 50 | public abstract String toString(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/rdf/tree/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Abstractions representing forests, trees, nodes and paths in decision forests. 18 | */ 19 | package com.cloudera.oryx.app.rdf.tree; -------------------------------------------------------------------------------- /app/oryx-app-common/src/main/java/com/cloudera/oryx/app/schema/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Encapsulation of basic input schema-related information common to many 18 | * applications. 19 | */ 20 | package com.cloudera.oryx.app.schema; -------------------------------------------------------------------------------- /app/oryx-app-common/src/test/java/com/cloudera/oryx/app/als/AbstractFeatureVectorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.als; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Executors; 20 | 21 | import org.junit.After; 22 | 23 | import com.cloudera.oryx.common.OryxTest; 24 | 25 | abstract class AbstractFeatureVectorTest extends OryxTest { 26 | 27 | private ExecutorService executor = null; 28 | 29 | synchronized ExecutorService getExecutor() { 30 | if (executor == null) { 31 | executor = Executors.newCachedThreadPool(); 32 | } 33 | return executor; 34 | } 35 | 36 | @After 37 | public synchronized void tearDownExecutor() { 38 | if (executor != null) { 39 | executor.shutdown(); 40 | executor = null; 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/test/java/com/cloudera/oryx/app/classreg/example/CategoricalFeatureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.classreg.example; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | /** 23 | * Tests {@link CategoricalFeature}. 24 | */ 25 | public final class CategoricalFeatureTest extends OryxTest { 26 | 27 | @Test 28 | public void testFeature() { 29 | CategoricalFeature f = CategoricalFeature.forEncoding(1); 30 | assertEquals(FeatureType.CATEGORICAL, f.getFeatureType()); 31 | assertEquals(1, f.getEncoding()); 32 | assertEquals(f, CategoricalFeature.forEncoding(1)); 33 | // Not necessary for correctness to assert this, but fairly important for performance 34 | assertSame(f, CategoricalFeature.forEncoding(1)); 35 | } 36 | 37 | @Test 38 | public void testToString() { 39 | CategoricalFeature f = CategoricalFeature.forEncoding(1); 40 | assertEquals(":1", f.toString()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/oryx-app-common/src/test/java/com/cloudera/oryx/app/kmeans/EuclideanDistanceFnTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. and Intel Corp. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.kmeans; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | public final class EuclideanDistanceFnTest extends OryxTest { 23 | 24 | @Test 25 | public void testDistance() { 26 | assertEquals(Math.sqrt(14.0), 27 | new EuclideanDistanceFn().applyAsDouble(new double[] { 1.0, 2.0, 3.0 }, 28 | new double[] { 0.0, 4.0, 6.0 })); 29 | assertEquals(Math.sqrt(2.0), 30 | new EuclideanDistanceFn().applyAsDouble(new double[] { 0.0, 1.0 }, 31 | new double[] { -1.0, 0.0 })); 32 | assertEquals(0.0, new EuclideanDistanceFn().applyAsDouble(new double[] { 1.0 }, new double[] { 1.0 })); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/main/java/com/cloudera/oryx/app/batch/mllib/als/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Batch Layer, for ALS recommendations, using Spark MLlib. 18 | */ 19 | package com.cloudera.oryx.app.batch.mllib.als; -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/main/java/com/cloudera/oryx/app/batch/mllib/kmeans/KMeansEvalStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.batch.mllib.kmeans; 17 | 18 | /** 19 | * Evaluation metrics for k-means clustering. 20 | */ 21 | public enum KMeansEvalStrategy { 22 | 23 | /* Sum of Squared Errors, default */ 24 | SSE, 25 | 26 | /* Davies Bouldin Index, lower is better */ 27 | DAVIES_BOULDIN, 28 | 29 | /* Dunn Index, higher is better */ 30 | DUNN, 31 | 32 | /* Silhouette Coefficient, Range is [-1,1], 1 being the best, -1 the worst */ 33 | SILHOUETTE, 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/main/java/com/cloudera/oryx/app/batch/mllib/kmeans/SumSquaredError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.batch.mllib.kmeans; 17 | 18 | import java.util.Collection; 19 | 20 | import org.apache.spark.api.java.JavaRDD; 21 | import org.apache.spark.mllib.linalg.Vector; 22 | 23 | import com.cloudera.oryx.app.kmeans.ClusterInfo; 24 | 25 | final class SumSquaredError extends AbstractKMeansEvaluation { 26 | 27 | SumSquaredError(Collection clusters) { 28 | super(clusters); 29 | } 30 | 31 | @Override 32 | double evaluate(JavaRDD evalData) { 33 | return fetchClusterMetrics(evalData).values().mapToDouble(ClusterMetric::getSumSquaredDist).sum(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/main/java/com/cloudera/oryx/app/batch/mllib/kmeans/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Batch Layer, for k-means clustering, 18 | * using Spark MLlib. 19 | */ 20 | package com.cloudera.oryx.app.batch.mllib.kmeans; -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/main/java/com/cloudera/oryx/app/batch/mllib/rdf/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Batch Layer, for random decision forest-based 18 | * clustering and regression, using Spark MLlib. 19 | */ 20 | package com.cloudera.oryx.app.batch.mllib.rdf; -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/test/java/com/cloudera/oryx/app/batch/mllib/als/ALSUpdateTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.batch.mllib.als; 17 | 18 | import org.apache.spark.mllib.recommendation.Rating; 19 | import org.junit.Test; 20 | 21 | import com.cloudera.oryx.common.OryxTest; 22 | 23 | public final class ALSUpdateTest extends OryxTest { 24 | 25 | @Test 26 | public void testDecay() { 27 | Rating rating = new Rating(1, 2, 3.0); 28 | long timestamp = 10_000_000L; 29 | 30 | Rating noDecay = ALSUpdate.decayRating(rating, timestamp, timestamp, 0.5); 31 | assertEquals(1, noDecay.user()); 32 | assertEquals(2, noDecay.product()); 33 | assertEquals(3.0, noDecay.rating()); 34 | 35 | Rating dayDecay = ALSUpdate.decayRating(rating, timestamp, timestamp + 86_400_000L, 0.5); 36 | assertEquals(1, dayDecay.user()); 37 | assertEquals(2, dayDecay.product()); 38 | assertEquals(1.5, dayDecay.rating()); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/test/java/com/cloudera/oryx/app/batch/mllib/als/AbstractALSIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.batch.mllib.als; 17 | 18 | import com.cloudera.oryx.app.batch.mllib.AbstractAppMLlibIT; 19 | 20 | public abstract class AbstractALSIT extends AbstractAppMLlibIT { 21 | // nothing here yet 22 | } 23 | -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/test/java/com/cloudera/oryx/app/batch/mllib/kmeans/AbstractKMeansIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.batch.mllib.kmeans; 17 | 18 | import com.cloudera.oryx.app.batch.mllib.AbstractAppMLlibIT; 19 | 20 | abstract class AbstractKMeansIT extends AbstractAppMLlibIT { 21 | 22 | static final int NUM_CLUSTERS = 3; 23 | static final int NUM_FEATURES = 5; 24 | static final KMeansEvalStrategy EVALUATION_STRATEGY = KMeansEvalStrategy.SSE; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/oryx-app-mllib/src/test/java/com/cloudera/oryx/app/batch/mllib/rdf/AbstractRDFIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.batch.mllib.rdf; 17 | 18 | import com.cloudera.oryx.app.batch.mllib.AbstractAppMLlibIT; 19 | 20 | abstract class AbstractRDFIT extends AbstractAppMLlibIT { 21 | 22 | static final int MAX_DEPTH = 8; 23 | static final int MAX_SPLIT_CANDIDATES = 100; 24 | static final String IMPURITY = "entropy"; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/IDCount.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving; 17 | 18 | /** 19 | * Encapsulates a String ID and a count. 20 | */ 21 | public final class IDCount extends IDEntity { 22 | 23 | private final int count; 24 | 25 | public IDCount() { 26 | this(null, 0); 27 | } 28 | 29 | public IDCount(String id, int count) { 30 | super(id); 31 | this.count = count; 32 | } 33 | 34 | public int getCount() { 35 | return count; 36 | } 37 | 38 | @Override 39 | public String valueString() { 40 | return Integer.toString(count); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/IDEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving; 17 | 18 | import java.io.Serializable; 19 | 20 | import com.cloudera.oryx.api.serving.HasCSV; 21 | 22 | /** 23 | * Superclass of objects that encapsulate, among other things, a String ID. 24 | */ 25 | abstract class IDEntity implements HasCSV, Serializable { 26 | 27 | private final String id; 28 | 29 | IDEntity(String id) { 30 | this.id = id; 31 | } 32 | 33 | public final String getID() { 34 | return id; 35 | } 36 | 37 | abstract String valueString(); 38 | 39 | @Override 40 | public final String toString() { 41 | return id + ':' + valueString(); 42 | } 43 | 44 | @Override 45 | public final String toCSV() { 46 | return id + ',' + valueString(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/IDValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving; 17 | 18 | /** 19 | * Encapsulates a String ID and a floating-point value. 20 | */ 21 | public final class IDValue extends IDEntity { 22 | 23 | private final double value; 24 | 25 | public IDValue() { 26 | this(null, 0.0); 27 | } 28 | 29 | public IDValue(String id, double value) { 30 | super(id); 31 | this.value = value; 32 | } 33 | 34 | public double getValue() { 35 | return value; 36 | } 37 | 38 | @Override 39 | public String valueString() { 40 | return Double.toString(value); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/Ready.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving; 17 | 18 | import javax.inject.Singleton; 19 | import javax.ws.rs.GET; 20 | import javax.ws.rs.HEAD; 21 | import javax.ws.rs.Path; 22 | import javax.ws.rs.core.Response; 23 | 24 | import com.cloudera.oryx.api.serving.OryxServingException; 25 | 26 | /** 27 | *

Responds to a HEAD or GET request to {@code /ready} 28 | * and returns {@link Response.Status#OK} 29 | * or {@link Response.Status#SERVICE_UNAVAILABLE} status depending or whether the model is 30 | * available or not.

31 | */ 32 | @Singleton 33 | @Path("/ready") 34 | public final class Ready extends AbstractOryxResource { 35 | 36 | @HEAD 37 | public Response head() throws OryxServingException { 38 | return get(); 39 | } 40 | 41 | @GET 42 | public Response get() throws OryxServingException { 43 | getServingModel(); // Make sure it doesn't error 44 | return Response.ok().build(); 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/AllItemIDs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import java.util.Collection; 19 | import javax.inject.Singleton; 20 | import javax.ws.rs.GET; 21 | import javax.ws.rs.Path; 22 | import javax.ws.rs.Produces; 23 | import javax.ws.rs.core.MediaType; 24 | 25 | import com.cloudera.oryx.api.serving.OryxServingException; 26 | 27 | /** 28 | *

Responds to a GET request to {@code /item/allIDs}.

29 | * 30 | *

CSV output consists of one ID per line. JSON output is an array of item IDs.

31 | */ 32 | @Singleton 33 | @Path("/item") 34 | public final class AllItemIDs extends AbstractALSResource { 35 | 36 | @GET 37 | @Path("/allIDs") 38 | @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) 39 | public Collection get() throws OryxServingException { 40 | return getALSServingModel().getAllItemIDs(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/AllUserIDs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import javax.inject.Singleton; 19 | import javax.ws.rs.GET; 20 | import javax.ws.rs.Path; 21 | import javax.ws.rs.Produces; 22 | import javax.ws.rs.core.MediaType; 23 | import java.util.Collection; 24 | 25 | import com.cloudera.oryx.api.serving.OryxServingException; 26 | 27 | /** 28 | *

Responds to a GET request to {@code /user/allIDs}.

29 | * 30 | *

CSV output consists of one ID per line. JSON output is an array of user IDs.

31 | */ 32 | @Singleton 33 | @Path("/user") 34 | public final class AllUserIDs extends AbstractALSResource { 35 | 36 | @GET 37 | @Path("/allIDs") 38 | @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) 39 | public Collection get() throws OryxServingException { 40 | return getALSServingModel().getAllUserIDs(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/Console.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import javax.inject.Singleton; 19 | import javax.ws.rs.Path; 20 | 21 | import com.cloudera.oryx.app.serving.AbstractConsoleResource; 22 | 23 | /** 24 | * ALS app Serving Layer console. 25 | */ 26 | @Singleton 27 | @Path("/{file:(index\\.html)?}") 28 | public final class Console extends AbstractConsoleResource { 29 | @Override 30 | protected String getConsoleResource() { 31 | return "als/als.html.fragment"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/CosineDistanceSensitiveFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import java.util.function.ToDoubleFunction; 19 | 20 | /** 21 | * Implementations of this type of function return a value that depends on 22 | * cosine distance to a target vector and thus makes sense to use with the 23 | * locality-sensitive hash logic in {@link com.cloudera.oryx.app.serving.als.model.ALSServingModel}. 24 | */ 25 | public interface CosineDistanceSensitiveFunction extends ToDoubleFunction { 26 | 27 | /** 28 | * @return vector whose cosine distance to other vectors influence the function value 29 | */ 30 | float[] getTargetVector(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/KnownItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import java.util.Collection; 19 | import javax.inject.Singleton; 20 | import javax.ws.rs.GET; 21 | import javax.ws.rs.Path; 22 | import javax.ws.rs.PathParam; 23 | import javax.ws.rs.Produces; 24 | import javax.ws.rs.core.MediaType; 25 | 26 | import com.cloudera.oryx.api.serving.OryxServingException; 27 | 28 | /** 29 | *

Responds to a GET request to {@code /knownItems/[userID]}.

30 | * 31 | *

CSV output consists of one ID per line. JSON output is an array of item IDs.

32 | */ 33 | @Singleton 34 | @Path("/knownItems") 35 | public final class KnownItems extends AbstractALSResource { 36 | 37 | @GET 38 | @Path("{userID}") 39 | @Produces({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) 40 | public Collection get(@PathParam("userID") String userID) throws OryxServingException { 41 | return getALSServingModel().getKnownItems(userID); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Data model support for the ALS recommender Serving Layer app. 18 | */ 19 | package com.cloudera.oryx.app.serving.als.model; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Serving Layer, for ALS recommendation. 18 | */ 19 | package com.cloudera.oryx.app.serving.als; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/classreg/model/ClassificationRegressionServingModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.classreg.model; 17 | 18 | import com.cloudera.oryx.api.serving.ServingModel; 19 | 20 | /** 21 | * Implementations are {@link ServingModel}s that specifically support classification 22 | * or regression problems. 23 | */ 24 | public interface ClassificationRegressionServingModel extends ServingModel { 25 | 26 | /** 27 | * @param example input features as parsed strings 28 | * @return prediction, as a string 29 | */ 30 | String predict(String[] example); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/classreg/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains app tier support code for implementations of classification and 18 | * regression in the Serving Layer. 19 | */ 20 | package com.cloudera.oryx.app.serving.classreg; 21 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/clustering/model/ClusteringServingModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.clustering.model; 17 | 18 | import com.cloudera.oryx.api.serving.ServingModel; 19 | 20 | /** 21 | * Implementations are {@link ServingModel}s that specifically support clustering problems. 22 | */ 23 | public interface ClusteringServingModel extends ServingModel { 24 | 25 | /** 26 | * @param datum input features as parsed strings 27 | * @return nearest cluster ID 28 | */ 29 | int nearestClusterID(String[] datum); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/clustering/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains app tier support code for implementations of clustering in the Serving Layer. 18 | */ 19 | package com.cloudera.oryx.app.serving.clustering.model; 20 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/kmeans/Console.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.kmeans; 17 | 18 | import javax.inject.Singleton; 19 | import javax.ws.rs.Path; 20 | 21 | import com.cloudera.oryx.app.serving.AbstractConsoleResource; 22 | 23 | /** 24 | * k-means app Serving Layer console. 25 | */ 26 | @Singleton 27 | @Path("/{file:(index\\.html)?}") 28 | public final class Console extends AbstractConsoleResource { 29 | @Override 30 | protected String getConsoleResource() { 31 | return "kmeans/kmeans.html.fragment"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/kmeans/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Data model support for the k-means clustering Serving Layer app. 18 | */ 19 | package com.cloudera.oryx.app.serving.kmeans.model; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/kmeans/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Serving Layer, for k-means clustering. 18 | */ 19 | package com.cloudera.oryx.app.serving.kmeans; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains common code supporting several implementations of an app-tier Serving Layer. 18 | */ 19 | package com.cloudera.oryx.app.serving; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/rdf/Console.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.rdf; 17 | 18 | import javax.inject.Singleton; 19 | import javax.ws.rs.Path; 20 | 21 | import com.cloudera.oryx.app.serving.AbstractConsoleResource; 22 | 23 | /** 24 | * Random decision forest app Serving Layer console. 25 | */ 26 | @Singleton 27 | @Path("/{file:(index\\.html)?}") 28 | public final class Console extends AbstractConsoleResource { 29 | @Override 30 | protected String getConsoleResource() { 31 | return "rdf/rdf.html.fragment"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/rdf/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Data model support for the random decision forest Serving Layer app. 18 | */ 19 | package com.cloudera.oryx.app.serving.rdf.model; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/rdf/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Serving Layer, for random decision forest 18 | * classification and regression. 19 | */ 20 | package com.cloudera.oryx.app.serving.rdf; -------------------------------------------------------------------------------- /app/oryx-app-serving/src/main/resources/com/cloudera/oryx/app/serving/console-footer.html.fragment: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/als/AllItemIDsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import java.util.List; 19 | import javax.ws.rs.core.MediaType; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | import com.cloudera.oryx.common.OryxTest; 25 | 26 | public final class AllItemIDsTest extends AbstractALSServingTest { 27 | 28 | @Test 29 | public void testAllItemIDs() { 30 | List items = target("/item/allIDs").request() 31 | .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_STRING_TYPE); 32 | Assert.assertEquals(9, items.size()); 33 | for (int item = 0; item < 9; item++) { 34 | OryxTest.assertContains(items, "I" + item); 35 | } 36 | } 37 | 38 | @Test 39 | public void testAllItemIDsCSV() { 40 | String response = target("/item/allIDs").request().get(String.class); 41 | Assert.assertEquals(9, response.split("\n").length); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/als/AllUserIDsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import javax.ws.rs.core.MediaType; 19 | import java.util.List; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | import com.cloudera.oryx.common.OryxTest; 25 | 26 | public final class AllUserIDsTest extends AbstractALSServingTest { 27 | 28 | @Test 29 | public void testAllItemIDs() { 30 | List users = target("/user/allIDs").request() 31 | .accept(MediaType.APPLICATION_JSON_TYPE).get(LIST_STRING_TYPE); 32 | Assert.assertEquals(7, users.size()); 33 | for (int user = 0; user < 7; user++) { 34 | OryxTest.assertContains(users, "U" + user); 35 | } 36 | } 37 | 38 | @Test 39 | public void testAllUserIDsCSV() { 40 | String response = target("/user/allIDs").request().get(String.class); 41 | Assert.assertEquals(7, response.split("\n").length); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/als/ReadyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als; 17 | 18 | import javax.ws.rs.core.Response; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | public final class ReadyTest extends AbstractALSServingTest { 24 | 25 | @Test 26 | public void testGet() { 27 | try (Response response = target("/ready").request().get()) { 28 | Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); 29 | } 30 | } 31 | 32 | @Test 33 | public void testHead() { 34 | try (Response response = target("/ready").request().head()) { 35 | Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/als/model/NullProvider2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.als.model; 17 | 18 | import com.cloudera.oryx.app.als.AbstractRescorerProvider; 19 | 20 | public final class NullProvider2 extends AbstractRescorerProvider { 21 | } 22 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/kmeans/DistanceToNearestTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.kmeans; 17 | 18 | import javax.ws.rs.core.MediaType; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | import com.cloudera.oryx.common.OryxTest; 24 | 25 | public final class DistanceToNearestTest extends AbstractKMeansServingTest { 26 | 27 | @Test 28 | public void testDistance() { 29 | String prediction = target("/distanceToNearest/1,0").request() 30 | .accept(MediaType.APPLICATION_JSON_TYPE).get(String.class); 31 | Assert.assertEquals(0.0, Double.parseDouble(prediction), OryxTest.DOUBLE_EPSILON); 32 | } 33 | 34 | @Test 35 | public void testDistance2() { 36 | String prediction = target("/distanceToNearest/10,-1.0").request().get(String.class); 37 | Assert.assertEquals(8.0, Double.parseDouble(prediction), OryxTest.DOUBLE_EPSILON); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/kmeans/ReadyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.kmeans; 17 | 18 | import javax.ws.rs.core.Response; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | public final class ReadyTest extends AbstractKMeansServingTest { 24 | 25 | @Test 26 | public void testGet() { 27 | try (Response response = target("/ready").request().get()) { 28 | Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); 29 | } 30 | } 31 | 32 | @Test 33 | public void testHead() { 34 | try (Response response = target("/ready").request().head()) { 35 | Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /app/oryx-app-serving/src/test/java/com/cloudera/oryx/app/serving/rdf/ReadyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.serving.rdf; 17 | 18 | import javax.ws.rs.core.Response; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | public final class ReadyTest extends AbstractRDFServingTest { 24 | 25 | @Test 26 | public void testGet() { 27 | try (Response response = target("/ready").request().get()) { 28 | Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); 29 | } 30 | } 31 | 32 | @Test 33 | public void testHead() { 34 | try (Response response = target("/ready").request().head()) { 35 | Assert.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /app/oryx-app/src/main/java/com/cloudera/oryx/app/speed/als/UserItemStrength.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.speed.als; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * Represents a user ID, item ID and a strength of interaction between them. 22 | */ 23 | final class UserItemStrength implements Serializable { 24 | 25 | private final String user; 26 | private final String item; 27 | private final float strength; 28 | 29 | UserItemStrength(String user, String item, float strength) { 30 | this.user = user; 31 | this.item = item; 32 | this.strength = strength; 33 | } 34 | 35 | public String getUser() { 36 | return user; 37 | } 38 | 39 | public String getItem() { 40 | return item; 41 | } 42 | 43 | public float getStrength() { 44 | return strength; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return user + ',' + item + ',' + strength; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/oryx-app/src/main/java/com/cloudera/oryx/app/speed/als/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Speed Layer, for ALS recommendation. 18 | */ 19 | package com.cloudera.oryx.app.speed.als; -------------------------------------------------------------------------------- /app/oryx-app/src/main/java/com/cloudera/oryx/app/speed/kmeans/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Speed Layer, for ALS recommendation. 18 | */ 19 | package com.cloudera.oryx.app.speed.kmeans; -------------------------------------------------------------------------------- /app/oryx-app/src/main/java/com/cloudera/oryx/app/speed/rdf/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains an app tier implementation of a Speed Layer, for random decision forest 18 | * classification and regression. 19 | */ 20 | package com.cloudera.oryx.app.speed.rdf; -------------------------------------------------------------------------------- /app/oryx-app/src/test/java/com/cloudera/oryx/app/speed/kmeans/KMeansSpeedModelTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.speed.kmeans; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import org.junit.Test; 22 | 23 | import com.cloudera.oryx.app.kmeans.ClusterInfo; 24 | import com.cloudera.oryx.common.OryxTest; 25 | 26 | public final class KMeansSpeedModelTest extends OryxTest { 27 | 28 | @Test 29 | public void update() { 30 | List clusters = new ArrayList<>(); 31 | clusters.add(new ClusterInfo(0, new double[]{-1.0, 2.0}, 2)); 32 | clusters.add(new ClusterInfo(1, new double[]{1.0, 3.0}, 3)); 33 | clusters.add(new ClusterInfo(2, new double[]{2.0, -1.0}, 4)); 34 | 35 | KMeansSpeedModel model = new KMeansSpeedModel(clusters); 36 | ClusterInfo cluster = model.getCluster(1); 37 | cluster.update(new double[]{-1.0,-1.0}, 3); 38 | 39 | assertEquals(1, cluster.getID()); 40 | assertEquals(6, cluster.getCount()); 41 | assertArrayEquals(new double[]{0.0,1.0}, cluster.getCenter()); 42 | } 43 | } -------------------------------------------------------------------------------- /app/oryx-app/src/test/java/com/cloudera/oryx/app/speed/rdf/MockRDFClassificationInputGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.speed.rdf; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | 20 | import com.cloudera.oryx.common.collection.Pair; 21 | import com.cloudera.oryx.kafka.util.DatumGenerator; 22 | 23 | public final class MockRDFClassificationInputGenerator implements DatumGenerator { 24 | 25 | @Override 26 | public Pair generate(int id, RandomGenerator random) { 27 | boolean positive = id % 2 != 0; 28 | String target = positive ? "banana" : "apple"; 29 | // 10% chance of wrong predictor 30 | String predictor = (positive ^ (random.nextDouble() < 0.1)) ? "yellow" : "red"; 31 | return new Pair<>(null, predictor + ',' + target); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/oryx-app/src/test/java/com/cloudera/oryx/app/speed/rdf/MockRDFRegressionInputGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.speed.rdf; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | 20 | import com.cloudera.oryx.common.collection.Pair; 21 | import com.cloudera.oryx.kafka.util.DatumGenerator; 22 | 23 | public final class MockRDFRegressionInputGenerator implements DatumGenerator { 24 | 25 | @Override 26 | public Pair generate(int id, RandomGenerator random) { 27 | boolean positive = id % 2 != 0; 28 | // Dummy decision rule is > 3.14 29 | double predictor = positive ? 3.14 + id : 3.14 - id; 30 | // Constructed so that means are about (1+3+5+7+9)/5 = 5 and -(0+2+4+6+8)/5 = -4 31 | double target = positive ? (id % 10) : -(id % 10); 32 | return new Pair<>(null, predictor + "," + target); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/oryx-app/src/test/java/com/cloudera/oryx/app/speed/rdf/MockRDFRegressionModelGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.app.speed.rdf; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | import org.dmg.pmml.PMML; 20 | 21 | import com.cloudera.oryx.app.rdf.RDFPMMLUtilsTest; 22 | import com.cloudera.oryx.common.collection.Pair; 23 | import com.cloudera.oryx.common.pmml.PMMLUtils; 24 | import com.cloudera.oryx.kafka.util.DatumGenerator; 25 | 26 | public final class MockRDFRegressionModelGenerator implements DatumGenerator { 27 | 28 | @Override 29 | public Pair generate(int id, RandomGenerator random) { 30 | PMML pmml = RDFPMMLUtilsTest.buildDummyRegressionModel(); 31 | return new Pair<>("MODEL", PMMLUtils.toString(pmml)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /deploy/oryx-batch/src/main/java/com/cloudera/oryx/batch/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.batch; 17 | 18 | import com.cloudera.oryx.common.settings.ConfigUtils; 19 | import com.cloudera.oryx.lambda.HadoopUtils; 20 | import com.cloudera.oryx.lambda.batch.BatchLayer; 21 | 22 | /** 23 | * Runs {@link BatchLayer} from the command line. It will use configuration as loaded 24 | * by TypeSafe Config's {@code ConfigFactory}. 25 | */ 26 | public final class Main { 27 | 28 | private Main() {} 29 | 30 | public static void main(String[] args) throws Exception { 31 | try (BatchLayer batchLayer = new BatchLayer<>(ConfigUtils.getDefault())) { 32 | HadoopUtils.closeAtShutdown(batchLayer); 33 | batchLayer.start(); 34 | batchLayer.await(); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /deploy/oryx-batch/src/main/java/com/cloudera/oryx/batch/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the actual Batch Layer packaged application. 18 | */ 19 | package com.cloudera.oryx.batch; -------------------------------------------------------------------------------- /deploy/oryx-serving/src/main/java/com/cloudera/oryx/serving/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. and Intel Corp. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.serving; 17 | 18 | import com.cloudera.oryx.common.lang.JVMUtils; 19 | import com.cloudera.oryx.common.settings.ConfigUtils; 20 | import com.cloudera.oryx.lambda.serving.ServingLayer; 21 | 22 | /** 23 | * Runs {@link ServingLayer} from the command line. It will use configuration as loaded 24 | * by TypeSafe Config's {@code ConfigFactory}. 25 | */ 26 | public final class Main { 27 | 28 | private Main() {} 29 | 30 | public static void main(String[] args) throws Exception { 31 | try (ServingLayer servingLayer = new ServingLayer(ConfigUtils.getDefault())) { 32 | JVMUtils.closeAtShutdown(servingLayer); 33 | servingLayer.start(); 34 | servingLayer.await(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /deploy/oryx-serving/src/main/java/com/cloudera/oryx/serving/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the actual Serving Layer packaged application. 18 | */ 19 | package com.cloudera.oryx.serving; -------------------------------------------------------------------------------- /deploy/oryx-speed/src/main/java/com/cloudera/oryx/speed/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.speed; 17 | 18 | import com.cloudera.oryx.common.settings.ConfigUtils; 19 | import com.cloudera.oryx.lambda.HadoopUtils; 20 | import com.cloudera.oryx.lambda.speed.SpeedLayer; 21 | 22 | /** 23 | * Runs {@link SpeedLayer} from the command line. It will use configuration as loaded 24 | * by TypeSafe Config's {@code ConfigFactory}. 25 | */ 26 | public final class Main { 27 | 28 | private Main() {} 29 | 30 | public static void main(String[] args) throws Exception { 31 | try (SpeedLayer speedLayer = new SpeedLayer<>(ConfigUtils.getDefault())) { 32 | HadoopUtils.closeAtShutdown(speedLayer); 33 | speedLayer.start(); 34 | speedLayer.await(); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /deploy/oryx-speed/src/main/java/com/cloudera/oryx/speed/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the actual Speed Layer packaged application. 18 | */ 19 | package com.cloudera.oryx.speed; -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | oryx.io 2 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/api/batch/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.api.batch (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.api.batch

13 |
14 |

Interfaces

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/api/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.api (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.api

13 |
14 |

Interfaces

15 | 19 |

Classes

20 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/api/speed/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.api.speed (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.api.speed

13 |
14 |

Interfaces

15 | 19 |

Classes

20 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/batch/mllib/als/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.batch.mllib.als (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.batch.mllib.als

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/batch/mllib/kmeans/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.batch.mllib.kmeans (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.batch.mllib.kmeans

13 |
14 |

Classes

15 | 18 |

Enums

19 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/batch/mllib/rdf/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.batch.mllib.rdf (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.batch.mllib.rdf

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/classreg/predict/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.classreg.predict (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.classreg.predict

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/common/fn/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.common.fn (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.common.fn

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/kmeans/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.kmeans (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.kmeans

13 |
14 |

Interfaces

15 | 18 |

Classes

19 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/pmml/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.pmml (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.pmml

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/rdf/decision/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.rdf.decision (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.rdf.decision

13 |
14 |

Classes

15 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/rdf/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.rdf (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.rdf

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/schema/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.schema (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.schema

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/als/model/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.als.model (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.als.model

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/classreg/model/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.classreg.model (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.classreg.model

13 |
14 |

Interfaces

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/classreg/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.classreg (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.classreg

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/clustering/model/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.clustering.model (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.clustering.model

13 |
14 |

Interfaces

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/clustering/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.clustering (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.clustering

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/kmeans/model/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.kmeans.model (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.kmeans.model

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/kmeans/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.kmeans (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.kmeans

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving

13 |
14 |

Classes

15 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/rdf/model/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.rdf.model (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.rdf.model

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/serving/rdf/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.serving.rdf (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.serving.rdf

13 |
14 |

Classes

15 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/speed/als/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.speed.als (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.speed.als

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/speed/kmeans/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.speed.kmeans (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.speed.kmeans

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/app/speed/rdf/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.app.speed.rdf (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.app.speed.rdf

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/batch/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.batch (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.batch

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/collection/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.collection (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.collection

13 |
14 |

Interfaces

15 | 18 |

Classes

19 | 23 |

Enums

24 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/io/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.io (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.io

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/math/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.math (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.math

13 |
14 |

Classes

15 | 21 |

Exceptions

22 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common

13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/pmml/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.pmml (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.pmml

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/random/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.random (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.random

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/settings/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.settings (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.settings

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/common/text/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.common.text (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.common.text

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/example/batch/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.example.batch (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.example.batch

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/example/serving/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.example.serving (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.example.serving

13 |
14 |

Classes

15 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/example/speed/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.example.speed (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.example.speed

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/kafka/util/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.kafka.util (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.kafka.util

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/lambda/batch/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.lambda.batch (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.lambda.batch

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/lambda/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.lambda (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.lambda

13 |
14 |

Classes

15 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/lambda/speed/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.lambda.speed (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.lambda.speed

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/ml/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.ml (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.ml

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/ml/param/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.ml.param (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.ml.param

13 |
14 |

Interfaces

15 | 18 |

Classes

19 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/serving/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.serving (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.serving

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/com/cloudera/oryx/speed/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.cloudera.oryx.speed (Oryx 2.8.0 API) 8 | 9 | 10 | 11 | 12 |

com.cloudera.oryx.speed

13 |
14 |

Classes

15 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/apidocs/script.js: -------------------------------------------------------------------------------- 1 | function show(type) 2 | { 3 | count = 0; 4 | for (var key in methods) { 5 | var row = document.getElementById(key); 6 | if ((methods[key] & type) != 0) { 7 | row.style.display = ''; 8 | row.className = (count++ % 2) ? rowColor : altColor; 9 | } 10 | else 11 | row.style.display = 'none'; 12 | } 13 | updateTabs(type); 14 | } 15 | 16 | function updateTabs(type) 17 | { 18 | for (var value in tabs) { 19 | var sNode = document.getElementById(tabs[value][0]); 20 | var spanNode = sNode.firstChild; 21 | if (value == type) { 22 | sNode.className = activeTableTab; 23 | spanNode.innerHTML = tabs[value][1]; 24 | } 25 | else { 26 | sNode.className = tableTab; 27 | spanNode.innerHTML = "" + tabs[value][1] + ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/css/bootswatch.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 80px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | .navbar a > i { 7 | opacity: 0.5; 8 | } 9 | 10 | .navbar a:hover > i { 11 | opacity: 1; 12 | } 13 | 14 | .subhead { 15 | padding-bottom: 0; 16 | margin-bottom: 9px; 17 | } 18 | 19 | .subhead h1 { 20 | font-size: 54px; 21 | } 22 | 23 | 24 | @media (max-width: 480px) { 25 | 26 | .modal { 27 | position: fixed !important; 28 | top: 25% !important; 29 | } 30 | } 31 | 32 | 33 | @media (max-width: 767px) { 34 | 35 | body { 36 | padding-top: 0; 37 | } 38 | } 39 | 40 | /* Portrait tablet to landscape and desktop */ 41 | @media (min-width: 768px) and (max-width: 979px) { 42 | 43 | .thumbnail p { 44 | font-size: 12px; 45 | } 46 | 47 | .thumbnail .btn { 48 | padding: 8px 12px; 49 | font-size: 12px; 50 | } 51 | } 52 | 53 | @media (min-width: 768px) and (max-width: 979px) { 54 | 55 | /* Remove any padding from the body */ 56 | body { 57 | padding-top: 0; 58 | } 59 | } 60 | 61 | @media (max-width: 980px) { 62 | 63 | /* Unfloat brand */ 64 | .navbar-fixed-top .brand { 65 | float: left; 66 | margin-left: 0; 67 | padding-left: 10px; 68 | padding-right: 10px; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /docs/css/print.css: -------------------------------------------------------------------------------- 1 | .navbar, 2 | .breadcrumb, 3 | .toc-separator 4 | #toc-bar, 5 | #toc-sidebar, 6 | footer, 7 | .subfooter { 8 | display: none !important; 9 | } 10 | 11 | body { 12 | padding-top: 0px !important; 13 | } 14 | 15 | /* CSS below taken from HTML5 Boilerplate */ 16 | * { 17 | background: transparent !important; 18 | color: #000 !important; /* Black prints faster: h5bp.com/s */ 19 | box-shadow:none !important; 20 | text-shadow: none !important; 21 | } 22 | 23 | a, 24 | a:visited { 25 | text-decoration: underline; 26 | } 27 | 28 | a[href]:after { 29 | content: " (" attr(href) ")"; 30 | } 31 | 32 | abbr[title]:after { 33 | content: " (" attr(title) ")"; 34 | } 35 | 36 | /* 37 | * Don't show links for images, or javascript/internal links, or header links 38 | */ 39 | 40 | header a:after, 41 | .ir a:after, 42 | a[href^="javascript:"]:after, 43 | a[href^="#"]:after { 44 | content: "" !important; 45 | } 46 | 47 | pre, 48 | blockquote { 49 | border: 1px solid #999; 50 | page-break-inside: avoid; 51 | } 52 | 53 | thead { 54 | display: table-header-group; /* h5bp.com/t */ 55 | } 56 | 57 | tr, 58 | img { 59 | page-break-inside: avoid; 60 | } 61 | 62 | img { 63 | max-width: 100% !important; 64 | } 65 | 66 | @page { 67 | margin: 0.5cm; 68 | } 69 | 70 | p, 71 | h2, 72 | h3 { 73 | orphans: 3; 74 | widows: 3; 75 | } 76 | 77 | h2, 78 | h3 { 79 | page-break-after: avoid; 80 | } 81 | -------------------------------------------------------------------------------- /docs/css/site.css: -------------------------------------------------------------------------------- 1 | /* You can override this file with your own styles */ -------------------------------------------------------------------------------- /docs/img/Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/Architecture.png -------------------------------------------------------------------------------- /docs/img/OryxLogoMedium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/OryxLogoMedium.png -------------------------------------------------------------------------------- /docs/img/OryxLogoSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/OryxLogoSmall.png -------------------------------------------------------------------------------- /docs/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/close.png -------------------------------------------------------------------------------- /docs/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /docs/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /docs/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/loading.gif -------------------------------------------------------------------------------- /docs/img/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/next.png -------------------------------------------------------------------------------- /docs/img/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/docs/img/prev.png -------------------------------------------------------------------------------- /docs/js/reflow-scroll.js: -------------------------------------------------------------------------------- 1 | // Support for smooth scrolling 2 | // (simplified version, taken from http://stackoverflow.com/a/14805098/1173184) 3 | $(window).load(function(){ 4 | $('a[href^="#"]:not([href^="#carousel"]):not([data-toggle="dropdown"])').on('click', function(e) { 5 | 6 | // prevent default anchor click behavior 7 | e.preventDefault(); 8 | 9 | // store hash 10 | var hash = this.hash; 11 | 12 | // animate 13 | $('html, body').animate({ 14 | scrollTop: $(this.hash).offset().top 15 | }, 300, function(){ 16 | 17 | // when done, add hash to url 18 | // (default click behaviour) 19 | window.location.hash = hash; 20 | }); 21 | 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /docs/js/reflow-skin.js: -------------------------------------------------------------------------------- 1 | // Additional skin Javascript 2 | // ++++++++++++++++++++++++++++++++++++++++++ 3 | 4 | !function ($) { 5 | 6 | $(function(){ 7 | 8 | var $window = $(window) 9 | 10 | // Start carousel 11 | $(function() { 12 | $('.carousel').carousel(); 13 | }); 14 | 15 | // activate syntax higlighting with highlight.js 16 | // Note: only run if `hljs` exists 17 | if (typeof hljs != 'undefined') 18 | { 19 | // classic encoding with
20 | // and HTML5 version with
21 | $('div.source pre, pre code').each(function(i, e) {hljs.highlightBlock(e)}); 22 | } 23 | 24 | }) 25 | 26 | }(window.jQuery) 27 | -------------------------------------------------------------------------------- /framework/kafka-util/src/main/java/com/cloudera/oryx/kafka/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Kafka-related utility code and command-line applications. 18 | */ 19 | package com.cloudera.oryx.kafka.util; -------------------------------------------------------------------------------- /framework/kafka-util/src/test/java/com/cloudera/oryx/kafka/util/DatumGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.kafka.util; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | 20 | import com.cloudera.oryx.common.collection.Pair; 21 | 22 | /** 23 | * Interface which generates one datum. 24 | * 25 | * @param key type 26 | * @param message type 27 | */ 28 | @FunctionalInterface 29 | public interface DatumGenerator { 30 | 31 | /** 32 | * @param id a unique identifier for datum being generated 33 | * @param random random number generator to use if randomness is needed 34 | * @return a datum, which may or may not use {@code id} or {@code random} 35 | */ 36 | Pair generate(int id, RandomGenerator random); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /framework/kafka-util/src/test/java/com/cloudera/oryx/kafka/util/DefaultCSVDatumGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.kafka.util; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | 20 | import com.cloudera.oryx.common.collection.Pair; 21 | 22 | /** 23 | * Interface which generates one random datum. 24 | */ 25 | public final class DefaultCSVDatumGenerator implements DatumGenerator { 26 | 27 | @Override 28 | public Pair generate(int id, RandomGenerator random) { 29 | return new Pair<>(Integer.toString(id), 30 | id + "," + 31 | random.nextInt(100) + ',' + 32 | random.nextBoolean() + ',' + 33 | random.nextGaussian()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/KeyMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.api; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * Simple interface encapsulating a key and message in a topic. 22 | * 23 | * @param key type 24 | * @param message type 25 | * @see KeyMessageImpl 26 | * @since 2.0.0 27 | */ 28 | public interface KeyMessage extends Serializable { 29 | 30 | /** 31 | * @return key 32 | * @since 2.0.0 33 | */ 34 | K getKey(); 35 | 36 | /** 37 | * @return message 38 | * @since 2.0.0 39 | */ 40 | M getMessage(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/batch/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Application API interface classes for the Batch Layer. 18 | */ 19 | package com.cloudera.oryx.api.batch; 20 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Application API interface classes common to all Layers. 18 | */ 19 | package com.cloudera.oryx.api; 20 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/serving/HasCSV.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.api.serving; 17 | 18 | /** 19 | * Implementations of this interface can produce a CSV representation. This is useful for 20 | * app endpoints that wish to return objects that can then automatically be translated 21 | * to CSV by the framework if a CSV response is requested. 22 | * 23 | * @since 2.2.0 24 | */ 25 | public interface HasCSV { 26 | 27 | /** 28 | * @return CSV string representation of this object 29 | * 30 | * @since 2.2.0 31 | */ 32 | String toCSV(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/serving/ServingModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.api.serving; 17 | 18 | /** 19 | * Interface that all Serving Layer in-memory models implement. 20 | * 21 | * @since 2.0.0 22 | */ 23 | public interface ServingModel { 24 | 25 | /** 26 | * @return fraction of IDs that were expected to be in the model whose value has been 27 | * loaded from an update 28 | * @since 2.0.0 29 | */ 30 | float getFractionLoaded(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/serving/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Application API interface classes for the Serving Layer. 18 | */ 19 | package com.cloudera.oryx.api.serving; 20 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/speed/SpeedModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.api.speed; 17 | 18 | /** 19 | * Interface that all Speed Layer in-memory models implement. 20 | * 21 | * @since 2.0.0 22 | */ 23 | public interface SpeedModel { 24 | 25 | /** 26 | * @return fraction of IDs that were expected to be in the model whose value has been 27 | * loaded from an update 28 | * @since 2.0.0 29 | */ 30 | float getFractionLoaded(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /framework/oryx-api/src/main/java/com/cloudera/oryx/api/speed/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Application API interface classes for the Speed Layer. 18 | */ 19 | package com.cloudera.oryx.api.speed; 20 | -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/collection/CloseableIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.collection; 17 | 18 | import java.io.Closeable; 19 | import java.util.Iterator; 20 | 21 | /** 22 | * Implementations are {@link Iterator}s that are also {@link Closeable}. 23 | * 24 | * @param iterator element type 25 | */ 26 | public interface CloseableIterator extends Iterator, Closeable { 27 | // Adds nothing, except no IOException from close() 28 | @Override 29 | void close(); 30 | } 31 | -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/collection/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Collection-related utility methods and support classes. 18 | */ 19 | package com.cloudera.oryx.common.collection; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/io/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Utility code and methods on top of Java's I/O packages that relate to input/output, 18 | * files, readers and writers. 19 | */ 20 | package com.cloudera.oryx.common.io; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/lang/ToDoubleObjDoubleBiFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.lang; 17 | 18 | /** 19 | * Analogous to both {@link java.util.function.ToDoubleBiFunction} and 20 | * {@link java.util.function.ObjDoubleConsumer}, combined. 21 | * 22 | * @param the type of the first argument to the function 23 | */ 24 | @FunctionalInterface 25 | public interface ToDoubleObjDoubleBiFunction { 26 | 27 | /** 28 | * Applies this function to the given arguments. 29 | * 30 | * @param t the first function argument 31 | * @param u the second function argument 32 | * @return the function result 33 | */ 34 | double applyAsDouble(T t, double u); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/lang/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains utility code related to the JVM, classes, logging and other concerns closely 18 | * related to the core language. 19 | */ 20 | package com.cloudera.oryx.common.lang; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/math/SingularMatrixSolverException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.math; 17 | 18 | /** 19 | * Throws when a system can't be solved because the input matrix is singular or 20 | * near-singular. Encapsulates its apparent rank too. 21 | */ 22 | public final class SingularMatrixSolverException extends RuntimeException { 23 | 24 | private final int apparentRank; 25 | 26 | public SingularMatrixSolverException(int apparentRank, String message) { 27 | super(message); 28 | this.apparentRank = apparentRank; 29 | } 30 | 31 | public int getApparentRank() { 32 | return apparentRank; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/math/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * General mathematical functions and related support code, including basic vector and 18 | * matrix operations. 19 | */ 20 | package com.cloudera.oryx.common.math; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains utility code common to all implementation modules. This should not be 18 | * required by user applications, or the API or utility modules, but is common 19 | * to all other modules. 20 | */ 21 | package com.cloudera.oryx.common; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/pmml/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Utility code related to parsing, writing and manipulating PMML representations 18 | * of models. 19 | */ 20 | package com.cloudera.oryx.common.pmml; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/random/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Utility code related to generating randomness and managing random state. 18 | */ 19 | package com.cloudera.oryx.common.random; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/settings/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Utility code pertaining to application configuration management. 18 | */ 19 | package com.cloudera.oryx.common.settings; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/java/com/cloudera/oryx/common/text/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains simple utility functions related to text parsing and formatting. 18 | */ 19 | package com.cloudera.oryx.common.text; -------------------------------------------------------------------------------- /framework/oryx-common/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.Target=System.out 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{1}:%L %m%n 6 | log4j.logger.org.apache.hadoop=INFO 7 | log4j.logger.org.apache.kafka=INFO 8 | log4j.logger.kafka=INFO 9 | log4j.logger.akka=WARN 10 | log4j.logger.org.apache.spark=INFO 11 | log4j.logger.org.apache.zookeeper=WARN 12 | log4j.logger.org.eclipse.jetty=WARN 13 | log4j.logger.org.I0Itec.zkclient=WARN 14 | -------------------------------------------------------------------------------- /framework/oryx-common/src/test/java/com/cloudera/oryx/common/lang/JVMUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.lang; 17 | 18 | import java.util.concurrent.atomic.AtomicInteger; 19 | 20 | import org.junit.Test; 21 | 22 | import com.cloudera.oryx.common.OryxTest; 23 | 24 | public final class JVMUtilsTest extends OryxTest { 25 | 26 | @Test 27 | public void testShutdownHook() { 28 | // Can't really test this except to verify that no exception is thrown now or at shutdown 29 | JVMUtils.closeAtShutdown(() -> {}); 30 | } 31 | 32 | @Test 33 | public void testRunHook() { 34 | OryxShutdownHook hook = new OryxShutdownHook(); 35 | AtomicInteger a = new AtomicInteger(); 36 | hook.addCloseable(() -> a.set(3)); 37 | hook.run(); 38 | assertEquals(3, a.get()); 39 | } 40 | 41 | @Test 42 | public void testUsedMemory() { 43 | // Reasonable guess 44 | assertGreaterOrEqual(JVMUtils.getUsedMemory(), 1L << 20); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /framework/oryx-common/src/test/java/com/cloudera/oryx/common/lang/RateLimitCheckTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.lang; 17 | 18 | import java.util.concurrent.TimeUnit; 19 | 20 | import org.junit.Test; 21 | 22 | import com.cloudera.oryx.common.OryxTest; 23 | 24 | public final class RateLimitCheckTest extends OryxTest { 25 | 26 | @Test 27 | public void testLimit() throws Exception { 28 | RateLimitCheck check = new RateLimitCheck(100, TimeUnit.MILLISECONDS); 29 | assertTrue(check.test()); 30 | assertFalse(check.test()); 31 | Thread.sleep(200); 32 | assertTrue(check.test()); 33 | assertFalse(check.test()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /framework/oryx-common/src/test/java/com/cloudera/oryx/common/random/RandomManagerRandomTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.random; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | import org.junit.Before; 20 | import org.junit.Ignore; 21 | import org.junit.Test; 22 | 23 | import com.cloudera.oryx.common.OryxTest; 24 | 25 | public final class RandomManagerRandomTest extends OryxTest { 26 | 27 | @Override 28 | @Before 29 | public void initRandom() { 30 | // specifically don't init random 31 | } 32 | 33 | // Not clear why this only fails on JenkinsDisable 34 | @Ignore 35 | @Test 36 | public void testRandomState() { 37 | RandomGenerator generator = RandomManager.getRandom(); 38 | double unseededValue = generator.nextDouble(); 39 | RandomManager.useTestSeed(); 40 | double seededValue = generator.nextDouble(); 41 | assertNotEquals(unseededValue, seededValue); 42 | assertEquals(seededValue, RandomManager.getRandom().nextDouble()); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /framework/oryx-common/src/test/java/com/cloudera/oryx/common/settings/ConfigToPropertiesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.common.settings; 17 | 18 | import java.util.List; 19 | 20 | import org.junit.Test; 21 | 22 | import com.cloudera.oryx.common.OryxTest; 23 | 24 | public final class ConfigToPropertiesTest extends OryxTest { 25 | 26 | @Test 27 | public void testToProperties() { 28 | List propertiesLines = ConfigToProperties.buildPropertiesLines(); 29 | assertContains(propertiesLines, "oryx.serving.api.secure-port=443"); 30 | assertNotContains(propertiesLines, "oryx.id=null"); 31 | propertiesLines.forEach(line -> assertTrue(line.startsWith("oryx."))); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /framework/oryx-common/src/test/resources/log4j.test.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.Target=System.out 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{1}:%L %m%n 6 | log4j.logger.org.apache.hadoop=WARN 7 | log4j.logger.org.apache.kafka=WARN 8 | log4j.logger.kafka=WARN 9 | log4j.logger.akka=WARN 10 | log4j.logger.org.apache.spark=WARN 11 | # Temporarily increase this to avoid harmless (?) WARNs about block replicated to 0 of 1 peers 12 | log4j.logger.org.apache.spark.storage.BlockManager=ERROR 13 | log4j.logger.org.apache.zookeeper=WARN 14 | # Temporarily increase this to avoid harmless (?) WARNs about connection 15 | log4j.logger.org.apache.zookeeper.ClientCnxn=ERROR 16 | log4j.logger.org.eclipse.jetty=WARN 17 | log4j.logger.org.I0Itec.zkclient=WARN -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/main/java/com/cloudera/oryx/lambda/serving/OryxExceptionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.serving; 17 | 18 | import javax.ws.rs.core.Response; 19 | import javax.ws.rs.ext.ExceptionMapper; 20 | import javax.ws.rs.ext.Provider; 21 | 22 | import com.cloudera.oryx.api.serving.OryxServingException; 23 | 24 | /** 25 | * Maps {@link OryxServingException} types to an HTTP {@link Response}. 26 | */ 27 | @Provider 28 | public final class OryxExceptionMapper implements ExceptionMapper { 29 | 30 | @Override 31 | public Response toResponse(OryxServingException exception) { 32 | Response.ResponseBuilder response = Response.status(exception.getStatusCode()); 33 | if (exception.getMessage() != null) { 34 | response = response.entity(exception.getMessage()); 35 | } 36 | return response.build(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/main/java/com/cloudera/oryx/lambda/serving/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the core support for the Lambda tier of the Serving Layers. 18 | */ 19 | package com.cloudera.oryx.lambda.serving; -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/test/java/com/cloudera/oryx/lambda/serving/HelloWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera and Intel, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.serving; 17 | 18 | import javax.ws.rs.GET; 19 | import javax.ws.rs.Path; 20 | 21 | @Path("/helloWorld") 22 | public final class HelloWorld { 23 | 24 | @GET 25 | public String sayHello() { 26 | return "Hello, World"; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/test/java/com/cloudera/oryx/lambda/serving/MockServingModelManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.serving; 17 | 18 | import java.util.Iterator; 19 | 20 | import com.typesafe.config.Config; 21 | import org.apache.hadoop.conf.Configuration; 22 | 23 | import com.cloudera.oryx.api.KeyMessage; 24 | import com.cloudera.oryx.api.serving.AbstractServingModelManager; 25 | import com.cloudera.oryx.api.serving.ServingModel; 26 | 27 | public final class MockServingModelManager extends AbstractServingModelManager { 28 | 29 | public MockServingModelManager(Config config) { 30 | super(config); 31 | } 32 | 33 | @Override 34 | public void consume(Iterator> updateIterator, Configuration hadoopConf) { 35 | // do nothing 36 | } 37 | 38 | @Override 39 | public ServingModel getModel() { 40 | return null; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/test/java/com/cloudera/oryx/lambda/serving/MockTopicProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.serving; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import com.cloudera.oryx.api.TopicProducer; 22 | import com.cloudera.oryx.common.collection.Pair; 23 | 24 | public final class MockTopicProducer implements TopicProducer { 25 | 26 | private static final List> DATA = new ArrayList<>(); 27 | 28 | public static List> getData() { 29 | return DATA; 30 | } 31 | 32 | @Override 33 | public String getUpdateBroker() { 34 | return null; 35 | } 36 | 37 | @Override 38 | public String getTopic() { 39 | return null; 40 | } 41 | 42 | @Override 43 | public void send(String key, String message) { 44 | DATA.add(new Pair<>(key, message)); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/test/java/com/cloudera/oryx/lambda/serving/OryxExceptionMapperTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.serving; 17 | 18 | import javax.ws.rs.core.Response; 19 | 20 | import org.junit.Test; 21 | 22 | import com.cloudera.oryx.api.serving.OryxServingException; 23 | import com.cloudera.oryx.common.OryxTest; 24 | 25 | public final class OryxExceptionMapperTest extends OryxTest { 26 | 27 | @Test 28 | public void testMap() { 29 | OryxExceptionMapper mapper = new OryxExceptionMapper(); 30 | OryxServingException ex = new OryxServingException(Response.Status.BAD_REQUEST, "Bad request"); 31 | Response response = mapper.toResponse(ex); 32 | assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); 33 | assertEquals("Bad request", response.getEntity().toString()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/test/java/com/cloudera/oryx/lambda/serving/TopicProducerImplTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.serving; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | public final class TopicProducerImplTest extends OryxTest { 23 | 24 | @Test 25 | public void testProducer() { 26 | String broker = "localhost:1234"; 27 | String topic = "DummyTopic"; 28 | try (TopicProducerImpl topicProducer = new TopicProducerImpl<>(broker, topic)) { 29 | assertEquals(broker, topicProducer.getUpdateBroker()); 30 | assertEquals(topic, topicProducer.getTopic()); 31 | //topicProducer.send("foo", "bar"); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /framework/oryx-lambda-serving/src/test/resources/oryxtest.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/framework/oryx-lambda-serving/src/test/resources/oryxtest.jks -------------------------------------------------------------------------------- /framework/oryx-lambda/src/main/java/com/cloudera/oryx/lambda/batch/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the core support for the Lambda tier of the Batch Layers. This is the lowest layer 18 | * of support, managing Spark Streaming updates and data movement to/from HDFS and Kafka topics. 19 | */ 20 | package com.cloudera.oryx.lambda.batch; -------------------------------------------------------------------------------- /framework/oryx-lambda/src/main/java/com/cloudera/oryx/lambda/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Code used across the Lambda tier. 18 | */ 19 | package com.cloudera.oryx.lambda; -------------------------------------------------------------------------------- /framework/oryx-lambda/src/main/java/com/cloudera/oryx/lambda/speed/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the core support for the Lambda tier of the Speed Layers. 18 | */ 19 | package com.cloudera.oryx.lambda.speed; -------------------------------------------------------------------------------- /framework/oryx-lambda/src/test/java/com/cloudera/oryx/lambda/HadoopUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | public final class HadoopUtilsTest extends OryxTest { 23 | 24 | @Test 25 | public void testShutdownHook() { 26 | // Can't really test this except to verify that no exception is thrown now or at shutdown 27 | HadoopUtils.closeAtShutdown(() -> {}); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /framework/oryx-lambda/src/test/java/com/cloudera/oryx/lambda/TopicProducerImplTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda; 17 | 18 | import org.junit.Test; 19 | 20 | import com.cloudera.oryx.common.OryxTest; 21 | 22 | public final class TopicProducerImplTest extends OryxTest { 23 | 24 | @Test 25 | public void testProducer() { 26 | String broker = "localhost:1234"; 27 | String topic = "DummyTopic"; 28 | try (TopicProducerImpl topicProducer = new TopicProducerImpl<>(broker, topic, true)) { 29 | assertEquals(broker, topicProducer.getUpdateBroker()); 30 | assertEquals(topic, topicProducer.getTopic()); 31 | //topicProducer.send("foo", "bar"); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /framework/oryx-lambda/src/test/java/com/cloudera/oryx/lambda/batch/WritableToValueFunctionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.batch; 17 | 18 | import org.apache.hadoop.io.Text; 19 | import org.apache.hadoop.io.Writable; 20 | import org.junit.Test; 21 | import scala.Tuple2; 22 | 23 | import com.cloudera.oryx.common.OryxTest; 24 | 25 | public final class WritableToValueFunctionTest extends OryxTest { 26 | 27 | @Test 28 | public void testFunction() { 29 | WritableToValueFunction function = 30 | new WritableToValueFunction<>(String.class, String.class, Text.class, Text.class); 31 | Tuple2 in = new Tuple2<>(new Text("bizz"), new Text("buzz")); 32 | Tuple2 out = function.call(in); 33 | assertEquals("bizz", out._1()); 34 | assertEquals("buzz", out._2()); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /framework/oryx-lambda/src/test/java/com/cloudera/oryx/lambda/speed/MockModelGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | package com.cloudera.oryx.lambda.speed; 17 | 18 | import org.apache.commons.math3.random.RandomGenerator; 19 | 20 | import com.cloudera.oryx.common.collection.Pair; 21 | import com.cloudera.oryx.kafka.util.DatumGenerator; 22 | 23 | final class MockModelGenerator implements DatumGenerator { 24 | 25 | @Override 26 | public Pair generate(int id, RandomGenerator random) { 27 | return new Pair<>((id % 10 == 0) ? "MODEL" : "UP", Integer.toString(id)); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /framework/oryx-ml/src/main/java/com/cloudera/oryx/ml/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * Contains the core support for the ML tier of the Batch and Speed layers. 18 | */ 19 | package com.cloudera.oryx.ml; -------------------------------------------------------------------------------- /framework/oryx-ml/src/main/java/com/cloudera/oryx/ml/param/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. 3 | * 4 | * Cloudera, Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"). You may not use this file except in 6 | * compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | * CONDITIONS OF ANY KIND, either express or implied. See the License for 12 | * the specific language governing permissions and limitations under the 13 | * License. 14 | */ 15 | 16 | /** 17 | * This package supports defining hyperparameter ranges and selecting combinations 18 | * of hyperparameter values from these ranges. 19 | */ 20 | package com.cloudera.oryx.ml.param; -------------------------------------------------------------------------------- /src/site/resources/img/Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/src/site/resources/img/Architecture.png -------------------------------------------------------------------------------- /src/site/resources/img/OryxLogoMedium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/src/site/resources/img/OryxLogoMedium.png -------------------------------------------------------------------------------- /src/site/resources/img/OryxLogoSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OryxProject/oryx/1bdcea7107dbe8666cf8d112acf90de47db6ce33/src/site/resources/img/OryxLogoSmall.png --------------------------------------------------------------------------------