[GitHub] metron issue #530: METRON-777 Metron Extension System and Parser Extensions

2017-08-13 Thread ottobackwards
Github user ottobackwards commented on the issue:

https://github.com/apache/metron/pull/530
  









*[bundles-lib/src/main/java/org/apache/metron/bundles/BundleThreadContextClassLoader.java,
 line 43 at 
r2](https://reviewable.io:443/reviews/apache/metron/530#-Kr7wzDH9halWFNY1USd-r2-43:-KrRDdWkwG4RlkudNqzn:b-7wc8nh)
 ([raw 
file](https://github.com/apache/metron/blob/571168d897cdd10bc616cef92b613763f76a1842/bundles-lib/src/main/java/org/apache/metron/bundles/BundleThreadContextClassLoader.java#L43)):*
Previously, ottobackwards 
wrote…

I don't like them either.  I thought about DI and other things, but I was 
avoiding major changes of that type.  I'm more willing now to part ways.


I have refactored the ExtensionManager, I'm going to refactor this as well 
to make it all simpler.

---


*Comments from 
[Reviewable](https://reviewable.io:443/reviews/apache/metron/530)*




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] metron issue #690: METRON-1091 Package STELLAR shell as stand alone

2017-08-13 Thread ottobackwards
Github user ottobackwards commented on the issue:

https://github.com/apache/metron/pull/690
  
@JonZeolla Thanks for the review!
There are several questions in the description that I think need to fall 
out of the review, one of them is where or how to document this.

Any ideas?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] metron issue #692: METRON-1107 add support for handling epoch dates in secon...

2017-08-13 Thread JonZeolla
Github user JonZeolla commented on the issue:

https://github.com/apache/metron/pull/692
  
Also, I did notice a couple of things when poking around that probably fit 
best into some new JIRAs that I at least wanted to mention here:
* It's somewhat unintuitive that we count [starting at zero for 
MONTH()](https://github.com/apache/metron/tree/master/metron-stellar/stellar-common#month),
 unlike WEEK_OF_MONTH, WEEK_OF_YEAR, DAY_OF_MONTH, and DAY_OF_WEEK.
* We don't comply with [ISO 
8601](https://en.wikipedia.org/wiki/ISO_8601#Week_dates) regarding the first 
day of the week (We use Sunday, ISO says Monday)

```
[Stellar]>>> MONTH()
7
[Stellar]>>> MONTH(1502664380)
7
[Stellar]>>> WEEK_OF_MONTH(1502664380)
3
[Stellar]>>> DAY_OF_MONTH(1502664380)
13
[Stellar]>>> WEEK_OF_YEAR(1502664380)
33
[Stellar]>>> DAY_OF_WEEK(1502664380)
1
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] metron pull request #692: METRON-1107 add support for handling epoch dates i...

2017-08-13 Thread JonZeolla
Github user JonZeolla commented on a diff in the pull request:

https://github.com/apache/metron/pull/692#discussion_r132855920
  
--- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/EpochUtils.java
 ---
@@ -0,0 +1,44 @@
+/**
+ * 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.metron.stellar.common.utils;
+
+/**
+ * Utility functions for working with numbers that represent different
+ * formats of EPOCH time.
+ */
+public class EpochUtils {
+
+  /**
+   * Ensures returns the passed value as milliseconds from EPOCH if the 
value is in seconds.
+   * This is done by looking at the number of digits.
+   * If there are 10, then the value is concidered to be in seconds and 
will by
+   * muliplited by 1000.
+   * If there not 10, then the original value will be returned.
+   *
+   *
+   * 
+   * @param canidate The Long value to concider
--- End diff --

`s/concider/consider/` for the whole file


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] metron pull request #692: METRON-1107 add support for handling epoch dates i...

2017-08-13 Thread JonZeolla
Github user JonZeolla commented on a diff in the pull request:

https://github.com/apache/metron/pull/692#discussion_r132855925
  
--- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/EpochUtils.java
 ---
@@ -0,0 +1,44 @@
+/**
+ * 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.metron.stellar.common.utils;
+
+/**
+ * Utility functions for working with numbers that represent different
+ * formats of EPOCH time.
+ */
+public class EpochUtils {
+
+  /**
+   * Ensures returns the passed value as milliseconds from EPOCH if the 
value is in seconds.
+   * This is done by looking at the number of digits.
+   * If there are 10, then the value is concidered to be in seconds and 
will by
+   * muliplited by 1000.
+   * If there not 10, then the original value will be returned.
+   *
+   *
+   * 
+   * @param canidate The Long value to concider
+   * @return A Long value
+   */
+  public static Long ensureEpochMillis(Long canidate) {
+int length = (int)Math.floor(Math.log10(canidate) + 1);
+return length == 10 ? canidate * 1000 : canidate;
--- End diff --

We should handle inputs of length 1-9 as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] metron pull request #692: METRON-1107 add support for handling epoch dates i...

2017-08-13 Thread JonZeolla
Github user JonZeolla commented on a diff in the pull request:

https://github.com/apache/metron/pull/692#discussion_r132855961
  
--- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/EpochUtils.java
 ---
@@ -0,0 +1,44 @@
+/**
+ * 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.metron.stellar.common.utils;
+
+/**
+ * Utility functions for working with numbers that represent different
+ * formats of EPOCH time.
+ */
+public class EpochUtils {
+
+  /**
+   * Ensures returns the passed value as milliseconds from EPOCH if the 
value is in seconds.
+   * This is done by looking at the number of digits.
+   * If there are 10, then the value is concidered to be in seconds and 
will by
+   * muliplited by 1000.
--- End diff --

`s/muliplited/multiplied/`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---