eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yonzhang2...@apache.org
Subject [1/7] incubator-eagle git commit: EAGLE-334 clean user profile code clean user profile code in Eagle 0.5 and redesign in Eagle 0.6
Date Fri, 10 Jun 2016 01:29:26 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop eef4930c3 -> 8b646715e


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8b646715/eagle-security/eagle-security-userprofile/training/src/test/java/org/apache/eagle/security/userprofile/model/UserProfileKDEModelerTest.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-userprofile/training/src/test/java/org/apache/eagle/security/userprofile/model/UserProfileKDEModelerTest.java
b/eagle-security/eagle-security-userprofile/training/src/test/java/org/apache/eagle/security/userprofile/model/UserProfileKDEModelerTest.java
deleted file mode 100644
index 89f7386..0000000
--- a/eagle-security/eagle-security-userprofile/training/src/test/java/org/apache/eagle/security/userprofile/model/UserProfileKDEModelerTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.security.userprofile.model;
-
-import org.apache.eagle.security.userprofile.model.kde.UserProfileKDEModeler;
-import org.apache.commons.math3.linear.Array2DRowRealMatrix;
-import org.apache.commons.math3.linear.RealMatrix;
-import org.junit.Assert;
-
-public class UserProfileKDEModelerTest {
-
-    @org.junit.Test
-    public void testBuild() throws Exception {
-        UserProfileKDEModeler modeler = new UserProfileKDEModeler();
-        String user = "user1";
-        final RealMatrix mockMatrix = new Array2DRowRealMatrix(buildMockData());
-        scala.collection.immutable.List<UserProfileKDEModel> testStatistics = modeler.build("default",user,
mockMatrix);
-        Assert.assertEquals(testStatistics.length(), 1);
-        UserProfileKDEModel model = testStatistics.head();
-        Assert.assertEquals(model.user(), "user1");
-        Assert.assertEquals(model.statistics().length, mockMatrix.getColumnDimension());
-        Assert.assertEquals(-36, model.minProbabilityEstimate(), 1.0);
-        Assert.assertEquals(-37, model.maxProbabilityEstimate(), 1.0);
-        Assert.assertEquals(-37, model.nintyFivePercentileEstimate(), 1.0);
-        Assert.assertEquals(-37, model.medianProbabilityEstimate(), 1.0);
-        Assert.assertEquals(true, model.statistics()[3].isLowVariant());
-        Assert.assertEquals(false, model.statistics()[0].isLowVariant());
-        Assert.assertEquals("setTimes", model.statistics()[3].getCommandName());
-        Assert.assertEquals("getfileinfo", model.statistics()[0].getCommandName());
-    }
-
-    private double[][] buildMockData(){
-        double[][] mockData = new double[][]{
-                {114503.0,2.8820906E7,123618.0,0.0,64.0,15772.0,186.0,24296.0,12.0,9.0,32.0},
-                {53300.0,390772.0,157626.0,0.0,67.0,10501.0,226.0,8567.0,14.0,0.0,12.0},
-                {25659.0,140858.0,35731.0,0.0,169.0,1619.0,520.0,2965.0,34.0,0.0,34.0}
-        };
-        return mockData;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8b646715/eagle-security/eagle-security-userprofile/training/src/test/scala/org/apache/eagle/security/userprofile/daemon/UtilsSpec.scala
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-userprofile/training/src/test/scala/org/apache/eagle/security/userprofile/daemon/UtilsSpec.scala
b/eagle-security/eagle-security-userprofile/training/src/test/scala/org/apache/eagle/security/userprofile/daemon/UtilsSpec.scala
deleted file mode 100644
index 18ef625..0000000
--- a/eagle-security/eagle-security-userprofile/training/src/test/scala/org/apache/eagle/security/userprofile/daemon/UtilsSpec.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.security.userprofile.daemon
-
-import org.apache.eagle.common.DateTimeUtil
-import org.joda.time.Period
-import org.scalatest._
-
-/**
- * @since  9/2/15
- */
-class UtilsSpec extends FlatSpec with Matchers{
-  import org.apache.eagle.security.userprofile.daemon.Utils._
-
-  it should "formatPathWithMilliseconds " in {
-    formatPathWithMilliseconds("/tmp/path/to/log.${yyyy-MM-dd-hh}.gz")(DateTimeUtil.humanDateToMilliseconds("2015-09-02
10:32:17,000")) should be ("/tmp/path/to/log.2015-09-02-10.gz")
-    formatPathWithMilliseconds("/tmp/path/to/${yyyy-MM-dd}/*.tar.gz")(DateTimeUtil.humanDateToMilliseconds("2015-09-02
10:32:17,000")) should be ("/tmp/path/to/2015-09-02/*.tar.gz")
-    formatPathWithMilliseconds("/tmp/path/to/${yyyy-MM-dd}/${yyyy-MM-dd-hh}.tar.gz")(DateTimeUtil.humanDateToMilliseconds("2015-09-02
10:32:17,000")) should be ("/tmp/path/to/2015-09-02/2015-09-02-10.tar.gz")
-  }
-
-  it should "formatPathsInDuration" in {
-    val pathes:Seq[String] = formatPathsInDuration("/tmp/path/to/log.${yyyy-MM-dd-hh}.gz",DateTimeUtil.humanDateToMilliseconds("2015-09-02
10:32:17,000"),Period.parse("P30D"))
-    //pathes.length should be (30 * 24)
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/8b646715/eagle-security/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-security/pom.xml b/eagle-security/pom.xml
index e1a6b6f..6b9a7af 100644
--- a/eagle-security/pom.xml
+++ b/eagle-security/pom.xml
@@ -35,7 +35,6 @@
         <module>eagle-security-common</module>
         <module>eagle-security-hdfs-auditlog</module>
         <module>eagle-security-maprfs-auditlog</module>
-        <module>eagle-security-userprofile</module>
         <module>eagle-security-hive</module>
         <module>eagle-security-hive-web</module>
         <module>eagle-security-hdfs-web</module>


Mime
View raw message