Restructuring das extension folder structure
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/41761afb Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/41761afb Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/41761afb Branch: refs/heads/stratos-4.1.x Commit: 41761afb230ecc7647dd037a53239a26afcb53ed Parents: e3f8bad Author: Thanuja <[email protected]> Authored: Tue Nov 24 12:24:34 2015 +0530 Committer: Thanuja <[email protected]> Committed: Tue Nov 24 12:24:34 2015 +0530 ---------------------------------------------------------------------- .../apache/stratos/das/extension/TimeUDF.java | 49 ++++++++++++++++++++ .../das/extension/spark/udf/TimeUDF.java | 49 -------------------- 2 files changed, 49 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/41761afb/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/TimeUDF.java ---------------------------------------------------------------------- diff --git a/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/TimeUDF.java b/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/TimeUDF.java new file mode 100644 index 0000000..b9846de --- /dev/null +++ b/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/TimeUDF.java @@ -0,0 +1,49 @@ +/* + * 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.stratos.das.extension; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Implementing UDF for implementing spark sql query related to time. + */ +public class TimeUDF { + /** + * Convert time(ms) to DateFormat + * + * @param timeStamp time in ms + * @return date as String + */ + public String time(Long timeStamp) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + Date date = new Date(timeStamp.longValue()); + return sdf.format(date); + } + + /** + * Get the current time in ms + * + * @param param + * @return + */ + public long current_time(Integer param) { + return System.currentTimeMillis(); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/41761afb/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/spark/udf/TimeUDF.java ---------------------------------------------------------------------- diff --git a/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/spark/udf/TimeUDF.java b/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/spark/udf/TimeUDF.java deleted file mode 100644 index 0b8f408..0000000 --- a/extensions/das/modules/stratos-das-extension/src/main/java/org/apache/stratos/das/extension/spark/udf/TimeUDF.java +++ /dev/null @@ -1,49 +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.stratos.das.extension.spark.udf; - -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * Implementing UDF for implementing spark sql query related to time. - */ -public class TimeUDF { - /** - * Convert time(ms) to DateFormat - * - * @param timeStamp time in ms - * @return date as String - */ - public String time(Long timeStamp) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - Date date = new Date(timeStamp.longValue()); - return sdf.format(date); - } - - /** - * Get the current time in ms - * - * @param param - * @return - */ - public long current_time(Integer param) { - return System.currentTimeMillis(); - } -} \ No newline at end of file
