> On 2012-04-16 17:32:38, Rohini Palaniswamy wrote: > > /trunk/src/java/org/apache/hcatalog/common/HCatLogUtil.java, line 115 > > <https://reviews.apache.org/r/4732/diff/1/?file=102090#file102090line115> > > > > It would be better to do String concatenation than string format. > > String.format is very costly as it does pattern matching. > > > > https://issues.apache.org/jira/browse/MAPREDUCE-1533
Formatting is only done when something is actually logged when using slf4j, which seems acceptable. > On 2012-04-16 17:32:38, Rohini Palaniswamy wrote: > > /trunk/src/java/org/apache/hcatalog/data/HCatRecordObjectInspectorFactory.java, > > line 62 > > <https://reviews.apache.org/r/4732/diff/1/?file=102092#file102092line62> > > > > You will have to do a isDebugEnabled() before the debug call. The main > > intention of it is to avoid the cost of string concatenation/parameter > > construction. > > > > http://logging.apache.org/log4j/1.2/manual.html#performance You don't need to do that with slf4j because formatting is only done when logging is on. - Thomas ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4732/#review6937 ----------------------------------------------------------- On 2012-04-16 06:31:43, Vandana Ayyalasomayajula wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/4732/ > ----------------------------------------------------------- > > (Updated 2012-04-16 06:31:43) > > > Review request for hcatalog, Sushanth Sowmyan, Francis Liu, and Thomas. > > > Summary > ------- > > We need to do the following things: > > + Use log4j across the board > + Introduce a class with methods to help logging, refactoring away the bunch > of these functions in HCatUtil right now > + Instrument debug logging with isLogEnabled checks on the log level > + remove all instances of commented code whose purpose was for debug logs > > > This addresses bug hcatalog-68. > https://issues.apache.org/jira/browse/hcatalog-68 > > > Diffs > ----- > > /trunk/ivy.xml 1325838 > > /trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java > 1325838 > /trunk/src/java/org/apache/hcatalog/common/HCatLogUtil.java PRE-CREATION > /trunk/src/java/org/apache/hcatalog/common/HCatUtil.java 1325838 > > /trunk/src/java/org/apache/hcatalog/data/HCatRecordObjectInspectorFactory.java > 1325838 > /trunk/src/java/org/apache/hcatalog/data/HCatRecordSerDe.java 1325838 > /trunk/src/java/org/apache/hcatalog/data/JsonSerDe.java 1325838 > > /trunk/src/java/org/apache/hcatalog/mapreduce/DefaultOutputCommitterContainer.java > 1325838 > /trunk/src/java/org/apache/hcatalog/mapreduce/HCatOutputFormat.java 1325838 > /trunk/src/java/org/apache/hcatalog/mapreduce/HCatRecordReader.java 1325838 > /trunk/src/java/org/apache/hcatalog/mapreduce/HCatSplit.java 1325838 > /trunk/src/java/org/apache/hcatalog/mapreduce/InitializeInput.java 1325838 > /trunk/src/test/org/apache/hcatalog/data/HCatDataCheckUtil.java 1325838 > /trunk/src/test/org/apache/hcatalog/data/TestJsonSerDe.java 1325838 > > Diff: https://reviews.apache.org/r/4732/diff > > > Testing > ------- > > Unit tests pass. Log messages verified from test logs. > > > Thanks, > > Vandana > >
