LENS-1030 : Fix logs flowing in query logs
Project: http://git-wip-us.apache.org/repos/asf/lens/repo Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/c0e0b0e3 Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/c0e0b0e3 Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/c0e0b0e3 Branch: refs/heads/current-release-line Commit: c0e0b0e3b6d4e9f5793041bf3849045d38851826 Parents: 0190ef5 Author: Amareshwari Sriramadasu <[email protected]> Authored: Tue Jul 19 15:58:24 2016 +0530 Committer: Amareshwari Sriramadasu <[email protected]> Committed: Tue Jul 19 15:58:24 2016 +0530 ---------------------------------------------------------------------- .../MappedDiagnosticLogSegregationContext.java | 5 + .../lens/server/AuthenticationFilter.java | 47 -------- .../java/org/apache/lens/server/BaseApp.java | 2 +- .../org/apache/lens/server/LensApplication.java | 2 - .../server/LensRequestContextInitFilter.java | 59 ---------- .../lens/server/LensRequestLoggingFilter.java | 79 +++++++++++++ .../server/query/QueryExecutionServiceImpl.java | 1 - .../src/main/resources/lensserver-default.xml | 8 +- .../server/query/QueryAPIErrorResponseTest.java | 6 +- lens-server/src/test/resources/lens-site.xml | 2 +- src/site/apt/admin/config.apt | 116 +++++++++---------- 11 files changed, 151 insertions(+), 176 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server-api/src/main/java/org/apache/lens/server/model/MappedDiagnosticLogSegregationContext.java ---------------------------------------------------------------------- diff --git a/lens-server-api/src/main/java/org/apache/lens/server/model/MappedDiagnosticLogSegregationContext.java b/lens-server-api/src/main/java/org/apache/lens/server/model/MappedDiagnosticLogSegregationContext.java index 7780dff..cde153b 100644 --- a/lens-server-api/src/main/java/org/apache/lens/server/model/MappedDiagnosticLogSegregationContext.java +++ b/lens-server-api/src/main/java/org/apache/lens/server/model/MappedDiagnosticLogSegregationContext.java @@ -41,6 +41,11 @@ public class MappedDiagnosticLogSegregationContext implements LogSegregationCont setQueryId(id); } + public static void removeLogSegragationIds() { + MDC.remove(LOG_SEGREGATION_ID); + MDC.remove(QUERY_LOG_ID); + } + @Override public String getQueryId() { return MDC.get(QUERY_LOG_ID); http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/java/org/apache/lens/server/AuthenticationFilter.java ---------------------------------------------------------------------- diff --git a/lens-server/src/main/java/org/apache/lens/server/AuthenticationFilter.java b/lens-server/src/main/java/org/apache/lens/server/AuthenticationFilter.java deleted file mode 100644 index e982520..0000000 --- a/lens-server/src/main/java/org/apache/lens/server/AuthenticationFilter.java +++ /dev/null @@ -1,47 +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.lens.server; - -import java.io.IOException; - -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.core.SecurityContext; - -import lombok.extern.slf4j.Slf4j; - -/** - * The Class AuthenticationFilter. - */ -@Slf4j -public class AuthenticationFilter implements ContainerRequestFilter { - - /* - * (non-Javadoc) - * - * @see javax.ws.rs.container.ContainerRequestFilter#filter(javax.ws.rs.container.ContainerRequestContext) - */ - @Override - public void filter(ContainerRequestContext requestContext) throws IOException { - - final SecurityContext securityContext = requestContext.getSecurityContext(); - String user = securityContext.getUserPrincipal() != null ? securityContext.getUserPrincipal().getName() : null; - log.info("Request from user: {} , path={}", user, requestContext.getUriInfo().getPath()); - } -} http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/java/org/apache/lens/server/BaseApp.java ---------------------------------------------------------------------- diff --git a/lens-server/src/main/java/org/apache/lens/server/BaseApp.java b/lens-server/src/main/java/org/apache/lens/server/BaseApp.java index 19de31c..32fc240 100644 --- a/lens-server/src/main/java/org/apache/lens/server/BaseApp.java +++ b/lens-server/src/main/java/org/apache/lens/server/BaseApp.java @@ -42,7 +42,7 @@ public abstract class BaseApp extends Application { classes.add(MultiPartFeature.class); classes.add(LensJAXBContextResolver.class); classes.add(LensJAXBValidationExceptionMapper.class); - classes.add(LensRequestContextInitFilter.class); + classes.add(LensRequestLoggingFilter.class); classes.add(LoggingFilter.class); classes.add(LensApplicationListener.class); classes.add(MoxyJsonConfigurationContextResolver.class); http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/java/org/apache/lens/server/LensApplication.java ---------------------------------------------------------------------- diff --git a/lens-server/src/main/java/org/apache/lens/server/LensApplication.java b/lens-server/src/main/java/org/apache/lens/server/LensApplication.java index bace84d..c3f9952 100644 --- a/lens-server/src/main/java/org/apache/lens/server/LensApplication.java +++ b/lens-server/src/main/java/org/apache/lens/server/LensApplication.java @@ -73,8 +73,6 @@ public class LensApplication extends Application { log.info("Added filter {}", wsFilterClass); } - log.debug("LensRequestContextInitFilter added..."); - classes.add(LensRequestContextInitFilter.class); classes.add(GenericExceptionMapper.class); return classes; } http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/java/org/apache/lens/server/LensRequestContextInitFilter.java ---------------------------------------------------------------------- diff --git a/lens-server/src/main/java/org/apache/lens/server/LensRequestContextInitFilter.java b/lens-server/src/main/java/org/apache/lens/server/LensRequestContextInitFilter.java deleted file mode 100644 index d2f2f91..0000000 --- a/lens-server/src/main/java/org/apache/lens/server/LensRequestContextInitFilter.java +++ /dev/null @@ -1,59 +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.lens.server; - -import java.io.IOException; -import java.util.UUID; - -import javax.annotation.Priority; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; - -import org.apache.lens.server.model.MappedDiagnosticLogSegregationContext; - -import lombok.extern.slf4j.Slf4j; - -/** - * LensRequestContextInitFilter is expected to be called before all other request filters. - * Priority value of 1 is to ensure the same. - * - */ -@Slf4j -@Priority(1) -public class LensRequestContextInitFilter implements ContainerRequestFilter { - - private static final String REQUEST_ID = "requestId"; - - @Override - public void filter(ContainerRequestContext requestContext) throws IOException { - - log.debug("Entering {}", getClass().getName()); - - /* Create a unique identifier for request */ - String uniqueRequesId = UUID.randomUUID().toString(); - - /* Add request id for appearing in every log line */ - new MappedDiagnosticLogSegregationContext().setLogSegregationId(uniqueRequesId); - - /* Add request id to headers */ - requestContext.getHeaders().add(REQUEST_ID, uniqueRequesId); - - log.debug("Leaving {}", getClass().getName()); - } -} http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/java/org/apache/lens/server/LensRequestLoggingFilter.java ---------------------------------------------------------------------- diff --git a/lens-server/src/main/java/org/apache/lens/server/LensRequestLoggingFilter.java b/lens-server/src/main/java/org/apache/lens/server/LensRequestLoggingFilter.java new file mode 100644 index 0000000..d23326c --- /dev/null +++ b/lens-server/src/main/java/org/apache/lens/server/LensRequestLoggingFilter.java @@ -0,0 +1,79 @@ +/** + * 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.lens.server; + +import java.io.IOException; +import java.util.UUID; + +import javax.annotation.Priority; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; +import javax.ws.rs.container.ContainerResponseContext; +import javax.ws.rs.container.ContainerResponseFilter; +import javax.ws.rs.core.SecurityContext; + +import org.apache.lens.server.model.MappedDiagnosticLogSegregationContext; + +import org.glassfish.jersey.filter.LoggingFilter; + +import lombok.extern.slf4j.Slf4j; + +/** + * LensRequestLoggingFilter is expected to be called before all other request filters. + * Priority value of 1 is to ensure the same. + * + */ +@Slf4j +@Priority(1) +public class LensRequestLoggingFilter implements ContainerRequestFilter, ContainerResponseFilter { + + private static final String REQUEST_ID = "requestId"; + // this is the property for logging filter id + private static final String LOGGING_FILTER_ID_PROPERTY = LoggingFilter.class.getName() + ".id"; + + @Override + public void filter(ContainerRequestContext requestContext) throws IOException { + + log.debug("Entering {}", getClass().getName()); + + /* Create a unique identifier for request */ + String uniqueRequesId = UUID.randomUUID().toString(); + + /* Add request id for appearing in every log line */ + new MappedDiagnosticLogSegregationContext().setLogSegregationId(uniqueRequesId); + + /* Add request id to headers */ + requestContext.getHeaders().add(REQUEST_ID, uniqueRequesId); + + final SecurityContext securityContext = requestContext.getSecurityContext(); + String user = securityContext.getUserPrincipal() != null ? securityContext.getUserPrincipal().getName() : null; + + log.info("Request from user: {} , path={} loggingFilter ID={}", user, requestContext.getUriInfo().getPath(), + requestContext.getProperty(LOGGING_FILTER_ID_PROPERTY)); + + log.debug("Leaving {}", getClass().getName()); + } + + @Override + public void filter(ContainerRequestContext containerRequestContext, ContainerResponseContext containerResponseContext) + throws IOException { + // Remove log segregation ids + MappedDiagnosticLogSegregationContext.removeLogSegragationIds(); + } +} http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java ---------------------------------------------------------------------- diff --git a/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java b/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java index 924466b..be0e2c8 100644 --- a/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java +++ b/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java @@ -3159,7 +3159,6 @@ public class QueryExecutionServiceImpl extends BaseLensService implements QueryE @Override public void run() { try { - logSegregationContext.setLogSegragationAndQueryId(finishedLensQuery.getHandle()); processWaitingQueries(finishedLensQuery); } catch (final Throwable e) { log.error("Error in processing waiting queries", e); http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/main/resources/lensserver-default.xml ---------------------------------------------------------------------- diff --git a/lens-server/src/main/resources/lensserver-default.xml b/lens-server/src/main/resources/lensserver-default.xml index b80e7ed..3ce8fc1 100644 --- a/lens-server/src/main/resources/lensserver-default.xml +++ b/lens-server/src/main/resources/lensserver-default.xml @@ -472,14 +472,14 @@ </property> <property> <name>lens.server.ws.filternames</name> - <value>authentication,consistentState,serverMode</value> + <value>requestlogger,consistentState,serverMode</value> <description>These JAX-RS filters would be started in the specified order when lens-server starts up</description> </property> <property> - <name>lens.server.authentication.ws.filter.impl</name> - <value>org.apache.lens.server.AuthenticationFilter</value> - <description>Implementation class for Authentication Filter</description> + <name>lens.server.requestlogger.ws.filter.impl</name> + <value>org.apache.lens.server.LensRequestLoggingFilter</value> + <description>Implementation class for Request logging Filter</description> </property> <property> http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/test/java/org/apache/lens/server/query/QueryAPIErrorResponseTest.java ---------------------------------------------------------------------- diff --git a/lens-server/src/test/java/org/apache/lens/server/query/QueryAPIErrorResponseTest.java b/lens-server/src/test/java/org/apache/lens/server/query/QueryAPIErrorResponseTest.java index fe9163f..8e21ae4 100644 --- a/lens-server/src/test/java/org/apache/lens/server/query/QueryAPIErrorResponseTest.java +++ b/lens-server/src/test/java/org/apache/lens/server/query/QueryAPIErrorResponseTest.java @@ -46,7 +46,7 @@ import org.apache.lens.api.result.LensErrorTO; import org.apache.lens.api.util.MoxyJsonConfigurationContextResolver; import org.apache.lens.cube.error.ColUnAvailableInTimeRange; import org.apache.lens.server.LensJerseyTest; -import org.apache.lens.server.LensRequestContextInitFilter; +import org.apache.lens.server.LensRequestLoggingFilter; import org.apache.lens.server.common.ErrorResponseExpectedData; import org.apache.lens.server.error.GenericExceptionMapper; import org.apache.lens.server.error.LensJAXBValidationExceptionMapper; @@ -90,10 +90,10 @@ public class QueryAPIErrorResponseTest extends LensJerseyTest { enable(TestProperties.LOG_TRAFFIC); enable(TestProperties.DUMP_ENTITY); - return new ResourceConfig(LensRequestContextInitFilter.class, SessionResource.class, MetastoreResource.class, + return new ResourceConfig(LensRequestLoggingFilter.class, SessionResource.class, MetastoreResource.class, QueryServiceResource.class, MultiPartFeature.class, GenericExceptionMapper.class, LensJAXBContextResolver.class, - LensRequestContextInitFilter.class, LensJAXBValidationExceptionMapper.class, + LensRequestLoggingFilter.class, LensJAXBValidationExceptionMapper.class, MoxyJsonConfigurationContextResolver.class, MoxyJsonFeature.class); } http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/lens-server/src/test/resources/lens-site.xml ---------------------------------------------------------------------- diff --git a/lens-server/src/test/resources/lens-site.xml b/lens-server/src/test/resources/lens-site.xml index 64e83be..908fbb2 100644 --- a/lens-server/src/test/resources/lens-site.xml +++ b/lens-server/src/test/resources/lens-site.xml @@ -157,7 +157,7 @@ <property> <name>lens.server.ws.filternames</name> - <value>authentication,consistentState,serverMode,logging</value> + <value>requestlogger,consistentState,serverMode,logging</value> <description>These JAX-RS filters would be started in the specified order when lens-server starts up</description> </property> http://git-wip-us.apache.org/repos/asf/lens/blob/c0e0b0e3/src/site/apt/admin/config.apt ---------------------------------------------------------------------- diff --git a/src/site/apt/admin/config.apt b/src/site/apt/admin/config.apt index 5b76069..852955b 100644 --- a/src/site/apt/admin/config.apt +++ b/src/site/apt/admin/config.apt @@ -42,122 +42,122 @@ Lens server configuration *--+--+---+--+ |9|lens.server.appevent.ws.listener.impl|org.apache.lens.server.LensApplicationListener|Implementation class for Lens Application Listener| *--+--+---+--+ -|10|lens.server.authentication.ws.filter.impl|org.apache.lens.server.AuthenticationFilter|Implementation class for Authentication Filter| +|10|lens.server.base.url|http://0.0.0.0:9999/lensapi/|The base url for the lens server| *--+--+---+--+ -|11|lens.server.base.url|http://0.0.0.0:9999/lensapi/|The base url for the lens server| +|11|lens.server.consistentState.ws.filter.impl|org.apache.lens.server.ConsistentStateFilter|Implementation class for ConsistentState Filter| *--+--+---+--+ -|12|lens.server.consistentState.ws.filter.impl|org.apache.lens.server.ConsistentStateFilter|Implementation class for ConsistentState Filter| +|12|lens.server.database.resource.dir|/tmp/lens/resources|Top level directory to store database specific static resources which are added to each database. To add a static resource for a DB, create a directory with the same name as that of the DB under this directory, and place the resources inside the DB directory. Any subdirectories under the DB directory and the resources under them will be ignored| *--+--+---+--+ -|13|lens.server.database.resource.dir|/tmp/lens/resources|Top level directory to store database specific static resources which are added to each database. To add a static resource for a DB, create a directory with the same name as that of the DB under this directory, and place the resources inside the DB directory. Any subdirectories under the DB directory and the resources under them will be ignored| +|13|lens.server.db.driver.name|org.hsqldb.jdbcDriver|Database driver for database where Finished queries have to be stored. Also used for database based user config loaders| *--+--+---+--+ -|14|lens.server.db.driver.name|org.hsqldb.jdbcDriver|Database driver for database where Finished queries have to be stored. Also used for database based user config loaders| +|14|lens.server.db.jdbc.pass| |JDBC Password for Finished queries table. Also used for database based user config loaders| *--+--+---+--+ -|15|lens.server.db.jdbc.pass| |JDBC Password for Finished queries table. Also used for database based user config loaders| +|15|lens.server.db.jdbc.url|jdbc:hsqldb:/tmp/lensserver/queries.db|JDBC URL where the database for storing finished queries is located. Also used for database based user config loaders| *--+--+---+--+ -|16|lens.server.db.jdbc.url|jdbc:hsqldb:/tmp/lensserver/queries.db|JDBC URL where the database for storing finished queries is located. Also used for database based user config loaders| +|16|lens.server.db.jdbc.user|SA|JDBC User for Finished queries table. Also used for database based user config loaders| *--+--+---+--+ -|17|lens.server.db.jdbc.user|SA|JDBC User for Finished queries table. Also used for database based user config loaders| -*--+--+---+--+ -|18|lens.server.db.validation.query|select 1 from INFORMATION_SCHEMA.SYSTEM_USERS|BasicDatasource has a config parameter called validationQuery. This query is run before passing the Datasource to the application to verify if connection is valid.\ | +|17|lens.server.db.validation.query|select 1 from INFORMATION_SCHEMA.SYSTEM_USERS|BasicDatasource has a config parameter called validationQuery. This query is run before passing the Datasource to the application to verify if connection is valid.\ | | | | |{{{http://commons.apache.org/proper/commons-dbcp/configuration.html}dbcp configuration}} \ | | | | |{{{http://stackoverflow.com/questions/10684244/dbcp-validationquery-for-different-databases}validationquery for different databases}} \ | | | | | | *--+--+---+--+ -|19|lens.server.domain|company.com|Server domain. This will be used in authentication and Sending emails to users. For the server, the username will be without domain and domain will come through conf.| +|18|lens.server.domain|company.com|Server domain. This will be used in authentication and Sending emails to users. For the server, the username will be without domain and domain will come through conf.| *--+--+---+--+ -|20|lens.server.driver.selector.class|org.apache.lens.server.api.driver.MinQueryCostSelector|Class for selecting best driver given the query context| +|19|lens.server.driver.selector.class|org.apache.lens.server.api.driver.MinQueryCostSelector|Class for selecting best driver given the query context| *--+--+---+--+ -|21|lens.server.drivers|hive:org.apache.lens.driver.hive.HiveDriver|Drivers enabled for this lens server instance| +|20|lens.server.drivers|hive:org.apache.lens.driver.hive.HiveDriver|Drivers enabled for this lens server instance| *--+--+---+--+ -|22|lens.server.duplicate.query.allowed|false|If this is false and same query is submitted by a user in the same session and with the same configuration while earlier query is not completed then lens server will return the handle of the previous query| +|21|lens.server.duplicate.query.allowed|false|If this is false and same query is submitted by a user in the same session and with the same configuration while earlier query is not completed then lens server will return the handle of the previous query| *--+--+---+--+ -|23|lens.server.enable.console.metrics|false|Enable metrics to be reported on console| +|22|lens.server.enable.console.metrics|false|Enable metrics to be reported on console| *--+--+---+--+ -|24|lens.server.enable.csv.metrics|false|Enable metrics to be reported as csv files in a directory| +|23|lens.server.enable.csv.metrics|false|Enable metrics to be reported as csv files in a directory| *--+--+---+--+ -|25|lens.server.enable.ganglia.metrics|false|Enable metrics to be reported on ganglia| +|24|lens.server.enable.ganglia.metrics|false|Enable metrics to be reported on ganglia| *--+--+---+--+ -|26|lens.server.enable.graphite.metrics|false|Enable metrics to be reported on graphite| +|25|lens.server.enable.graphite.metrics|false|Enable metrics to be reported on graphite| *--+--+---+--+ -|27|lens.server.enable.resource.method.metering|false|Whether to Enable metering for all resource methods.| +|26|lens.server.enable.resource.method.metering|false|Whether to Enable metering for all resource methods.| *--+--+---+--+ -|28|lens.server.estimate.pool.keepalive.millis|60000|Thread keep alive time in milliseconds for the estimate thread pool. If there are no estimate requests for this period,then cached threads are released from the pool.| +|27|lens.server.estimate.pool.keepalive.millis|60000|Thread keep alive time in milliseconds for the estimate thread pool. If there are no estimate requests for this period,then cached threads are released from the pool.| *--+--+---+--+ -|29|lens.server.estimate.pool.max.threads|100|Maximum number of threads in the estimate thread pool| +|28|lens.server.estimate.pool.max.threads|100|Maximum number of threads in the estimate thread pool| *--+--+---+--+ -|30|lens.server.estimate.pool.min.threads|3|Minimum number of threads in the estimate thread pool| +|29|lens.server.estimate.pool.min.threads|3|Minimum number of threads in the estimate thread pool| *--+--+---+--+ -|31|lens.server.estimate.timeout.millis|300000|Timeout for parallel query estimate calls in milliseconds. A driver needs to comeback with a query estimate within this timeout. If the timeout is reached, only the drivers that have provided an estimate would be considered for query selection. If the timeout is reached and none of the drivers have provided an estimate then estimate calls fails with an exception.| +|30|lens.server.estimate.timeout.millis|300000|Timeout for parallel query estimate calls in milliseconds. A driver needs to comeback with a query estimate within this timeout. If the timeout is reached, only the drivers that have provided an estimate would be considered for query selection. If the timeout is reached and none of the drivers have provided an estimate then estimate calls fails with an exception.| *--+--+---+--+ -|32|lens.server.event.service.thread.pool.size| |The size of thread pool for notifying events. The no value is specified, it uses the available processors as the number.| +|31|lens.server.event.service.thread.pool.size| |The size of thread pool for notifying events. The no value is specified, it uses the available processors as the number.| *--+--+---+--+ -|33|lens.server.hdfs.output.retention|1 day|hdfs output retention period. Default 1 day| +|32|lens.server.hdfs.output.retention|1 day|hdfs output retention period. Default 1 day| *--+--+---+--+ -|34|lens.server.index.ws.resource.impl|org.apache.lens.server.IndexResource|Implementation class for Index Resource| +|33|lens.server.index.ws.resource.impl|org.apache.lens.server.IndexResource|Implementation class for Index Resource| *--+--+---+--+ -|35|lens.server.inmemory.resultset.ttl.secs|300|This property defines the TTL(time to live) in seconds for all result sets of type InMemoryResultSet beyond which they are eligible for purging irrespective of whether the result set has been read or not. The default value is 300 seconds (5 minutes).| +|34|lens.server.inmemory.resultset.ttl.secs|300|This property defines the TTL(time to live) in seconds for all result sets of type InMemoryResultSet beyond which they are eligible for purging irrespective of whether the result set has been read or not. The default value is 300 seconds (5 minutes).| *--+--+---+--+ -|36|lens.server.log.ws.resource.impl|org.apache.lens.server.LogResource|Implementation class for Log Resource| +|35|lens.server.log.ws.resource.impl|org.apache.lens.server.LogResource|Implementation class for Log Resource| *--+--+---+--+ -|37|lens.server.mail.from.address|[email protected]|The from field in the notifier mail to the submitter.| +|36|lens.server.mail.from.address|[email protected]|The from field in the notifier mail to the submitter.| *--+--+---+--+ -|38|lens.server.mail.host|mail-host.company.com|SMTP Host for sending mail| +|37|lens.server.mail.host|mail-host.company.com|SMTP Host for sending mail| *--+--+---+--+ -|39|lens.server.mail.port|25|SMTP Port| +|38|lens.server.mail.port|25|SMTP Port| *--+--+---+--+ -|40|lens.server.mail.smtp.connectiontimeout|15000|Socket connection timeout value in milliseconds. This timeout is implemented by java.net.Socket. Default is 15 seconds.| +|39|lens.server.mail.smtp.connectiontimeout|15000|Socket connection timeout value in milliseconds. This timeout is implemented by java.net.Socket. Default is 15 seconds.| *--+--+---+--+ -|41|lens.server.mail.smtp.timeout|30000|Socket read timeout value in milliseconds. This timeout is implemented by java.net.Socket. Default is 30 seconds.| +|40|lens.server.mail.smtp.timeout|30000|Socket read timeout value in milliseconds. This timeout is implemented by java.net.Socket. Default is 30 seconds.| *--+--+---+--+ -|42|lens.server.max.sessions.per.user|10|Number of sessions can be allowed for each user. User has to close one of the active sessions to open a new session once limit is reached. Otherwise Server throws an exception by saying that opened session limit has been already reached for user.| +|41|lens.server.max.sessions.per.user|10|Number of sessions can be allowed for each user. User has to close one of the active sessions to open a new session once limit is reached. Otherwise Server throws an exception by saying that opened session limit has been already reached for user.| *--+--+---+--+ -|43|lens.server.metastore.service.impl|org.apache.lens.server.metastore.CubeMetastoreServiceImpl|Implementation class for metastore service| +|42|lens.server.metastore.service.impl|org.apache.lens.server.metastore.CubeMetastoreServiceImpl|Implementation class for metastore service| *--+--+---+--+ -|44|lens.server.metastore.ws.resource.impl|org.apache.lens.server.metastore.MetastoreResource|Implementation class for Metastore Resource| +|43|lens.server.metastore.ws.resource.impl|org.apache.lens.server.metastore.MetastoreResource|Implementation class for Metastore Resource| *--+--+---+--+ -|45|lens.server.metrics.csv.directory.path|metrics/|Path of the directory in which to report metrics as separate csv files.| +|44|lens.server.metrics.csv.directory.path|metrics/|Path of the directory in which to report metrics as separate csv files.| *--+--+---+--+ -|46|lens.server.metrics.ganglia.host| |The ganglia host name| +|45|lens.server.metrics.ganglia.host| |The ganglia host name| *--+--+---+--+ -|47|lens.server.metrics.ganglia.port| |The ganglia port| +|46|lens.server.metrics.ganglia.port| |The ganglia port| *--+--+---+--+ -|48|lens.server.metrics.graphite.host| |The graphite host name| +|47|lens.server.metrics.graphite.host| |The graphite host name| *--+--+---+--+ -|49|lens.server.metrics.graphite.port| |The graphite port| +|48|lens.server.metrics.graphite.port| |The graphite port| *--+--+---+--+ -|50|lens.server.metrics.reporting.period|10|The reporting period for metrics. The value is in seconds| +|49|lens.server.metrics.reporting.period|10|The reporting period for metrics. The value is in seconds| *--+--+---+--+ -|51|lens.server.mode|OPEN|The mode in which server should run. Allowed values are OPEN, READ_ONLY, METASTORE_READONLY, METASTORE_NODROP. OPEN mode will allow all requests. READ_ONLY mode will allow all requests on session resouce and only GET requests on all other resources. METASTORE_READONLY will allow GET on metastore and all other requests in other services. METASTORE_NODROP will not allow DELETE on metastore, will allow all other requests.| +|50|lens.server.mode|OPEN|The mode in which server should run. Allowed values are OPEN, READ_ONLY, METASTORE_READONLY, METASTORE_NODROP. OPEN mode will allow all requests. READ_ONLY mode will allow all requests on session resouce and only GET requests on all other resources. METASTORE_READONLY will allow GET on metastore and all other requests in other services. METASTORE_NODROP will not allow DELETE on metastore, will allow all other requests.| *--+--+---+--+ -|52|lens.server.moxyjson.ws.feature.impl|org.glassfish.jersey.moxy.json.MoxyJsonFeature|Enable Moxy json feature| +|51|lens.server.moxyjson.ws.feature.impl|org.glassfish.jersey.moxy.json.MoxyJsonFeature|Enable Moxy json feature| *--+--+---+--+ -|53|lens.server.moxyjsonconfigresovler.ws.feature.impl|org.apache.lens.api.util.MoxyJsonConfigurationContextResolver|Moxy json configuration resolver| +|52|lens.server.moxyjsonconfigresovler.ws.feature.impl|org.apache.lens.api.util.MoxyJsonConfigurationContextResolver|Moxy json configuration resolver| *--+--+---+--+ -|54|lens.server.multipart.ws.feature.impl|org.glassfish.jersey.media.multipart.MultiPartFeature|Implementation class for query scheduler resource| +|53|lens.server.multipart.ws.feature.impl|org.glassfish.jersey.media.multipart.MultiPartFeature|Implementation class for query scheduler resource| *--+--+---+--+ -|55|lens.server.persist.location|file:///tmp/lensserver|The directory in which lens server will persist its state when it is going down. The location be on any Hadoop compatible file system. Server will read from the location when it is restarted and recovery is enabled. So, Server should have both read and write permissions to the location| +|54|lens.server.persist.location|file:///tmp/lensserver|The directory in which lens server will persist its state when it is going down. The location be on any Hadoop compatible file system. Server will read from the location when it is restarted and recovery is enabled. So, Server should have both read and write permissions to the location| *--+--+---+--+ -|56|lens.server.query.acceptors| |Query Acceptors configured. Query acceptors are consulted first, before anything happens for the given query. They can either return null or return a messaging indicating why the given query shouldn't be accepted. These can be used to filter out queries at the earliest.| +|55|lens.server.query.acceptors| |Query Acceptors configured. Query acceptors are consulted first, before anything happens for the given query. They can either return null or return a messaging indicating why the given query shouldn't be accepted. These can be used to filter out queries at the earliest.| *--+--+---+--+ -|57|lens.server.query.launching.constraint.factories|org.apache.lens.server.query.constraint.TotalQueryCostCeilingConstraintFactory|Factories used to instantiate constraints enforced on queries by lens. Every Factory should be an implementation of org.apache.lens.server.api.common.ConfigBasedObjectCreationFactory and create an implementation of org.apache.lens.server.api.query.constraint.QueryLaunchingConstraint. A query will be launched only if all constraints pass.| +|56|lens.server.query.launching.constraint.factories|org.apache.lens.server.query.constraint.TotalQueryCostCeilingConstraintFactory|Factories used to instantiate constraints enforced on queries by lens. Every Factory should be an implementation of org.apache.lens.server.api.common.ConfigBasedObjectCreationFactory and create an implementation of org.apache.lens.server.api.query.constraint.QueryLaunchingConstraint. A query will be launched only if all constraints pass.| *--+--+---+--+ -|58|lens.server.query.phase1.rewriters| |Query phase 1 rewriters. This is to convert user query to cube query. The resulting cube query will be passed for validation and rewriting to hql query.\ | +|57|lens.server.query.phase1.rewriters| |Query phase 1 rewriters. This is to convert user query to cube query. The resulting cube query will be passed for validation and rewriting to hql query.\ | | | | |Use cases will be to use extra intelligence to convert user query to optimized cube query. \ | | | | |Or define shortcuts for certain frequently used queries :) | *--+--+---+--+ -|59|lens.server.query.resultset.retention|1 day|Lens query resultset retention period. Default 1 day| +|58|lens.server.query.resultset.retention|1 day|Lens query resultset retention period. Default 1 day| +*--+--+---+--+ +|59|lens.server.query.service.impl|org.apache.lens.server.query.QueryExecutionServiceImpl|Implementation class for query execution service| *--+--+---+--+ -|60|lens.server.query.service.impl|org.apache.lens.server.query.QueryExecutionServiceImpl|Implementation class for query execution service| +|60|lens.server.query.state.logger.enabled|true|Disable or enable the query state logger with this config. The location for the logger can be specified in logback xml for the class org.apache.lens.server.query.QueryExecutionServiceImpl.QueryStatusLogger| *--+--+---+--+ -|61|lens.server.query.state.logger.enabled|true|Disable or enable the query state logger with this config. The location for the logger can be specified in logback xml for the class org.apache.lens.server.query.QueryExecutionServiceImpl.QueryStatusLogger| +|61|lens.server.query.ws.resource.impl|org.apache.lens.server.query.QueryServiceResource|Implementation class for Query Resource| *--+--+---+--+ -|62|lens.server.query.ws.resource.impl|org.apache.lens.server.query.QueryServiceResource|Implementation class for Query Resource| +|62|lens.server.querypurger.sleep.interval|10000|The interval(milliseconds) with which purger to run periodically. Default 10 sec.| *--+--+---+--+ -|63|lens.server.querypurger.sleep.interval|10000|The interval(milliseconds) with which purger to run periodically. Default 10 sec.| +|63|lens.server.quota.service.impl|org.apache.lens.server.quota.QuotaServiceImpl|Implementation class for quota service| *--+--+---+--+ -|64|lens.server.quota.service.impl|org.apache.lens.server.quota.QuotaServiceImpl|Implementation class for quota service| +|64|lens.server.quota.ws.resource.impl|org.apache.lens.server.quota.QuotaResource|Implementation class for Quota Resource| *--+--+---+--+ -|65|lens.server.quota.ws.resource.impl|org.apache.lens.server.quota.QuotaResource|Implementation class for Quota Resource| +|65|lens.server.requestlogger.ws.filter.impl|org.apache.lens.server.LensRequestLoggingFilter|Implementation class for Request logging Filter| *--+--+---+--+ |66|lens.server.resultset.purge.enabled|false|Whether to purge the query results| *--+--+---+--+ @@ -259,7 +259,7 @@ Lens server configuration *--+--+---+--+ |115|lens.server.ws.featurenames|multipart,moxyjson,moxyjsonconfigresovler|These JAX-RS Feature(s) would be started in the specified order when lens-server starts up| *--+--+---+--+ -|116|lens.server.ws.filternames|authentication,consistentState,serverMode|These JAX-RS filters would be started in the specified order when lens-server starts up| +|116|lens.server.ws.filternames|requestlogger,consistentState,serverMode|These JAX-RS filters would be started in the specified order when lens-server starts up| *--+--+---+--+ |117|lens.server.ws.listenernames|appevent|These listeners would be called in the specified order when lens-server starts up| *--+--+---+--+
