首页 文章 精选 留言 我的

精选列表

搜索[成本控制],共10009篇文章
优秀的个人博客,低调大师

hive权限控制

<property> <name>hive.server2.authentication</name> <value>CUSTOM</value> </property> <property> <name>hive.server2.custom.authentication.class</name> <value>com.hiveserver.auth.CustomHiveServerAuth</value> </property> <property> <name>hive.server2.custom.authentication.file</name> <value>/home/soft/hive/conf/hiveserver2.users.conf</value> </property> <property> <name>hive.metastore.local</name> <value>false</value> </property> <property> <name>hive.metastore.uris</name> <value>thrift://spark01:9083</value> <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description> </property> <property> <name>hive.security.authenticator.manager</name> <value>org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator</value> <description> hive client authenticator manager class name. The user defined authenticator should implement interface org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider. </description> </property> <property> <name>hive.security.authorization.enabled</name> <value>true</value> <description>enable or disable the Hive client authorization</description> </property> <property> <name>hive.security.authorization.manager</name> <value>org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory</value> <description> The Hive client authorization manager class name. The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider. </description> </property> <property> <name>hive.users.in.admin.role</name> <value>root</value> <description> Comma separated list of users who are in admin role for bootstrapping. More users can be added in ADMIN role later. </description> </property> <property> <name>hive.server2.enable.doAs</name> <value>false</value> <description> Setting this property to true will have HiveServer2 execute Hive operations as the user making the calls to it. </description> </property> <property> <name>hive.server2.thrift.bind.host</name> <value>spark01</value> <description>Bind host on which to run the HiveServer2 Thrift service.</description> </property> <property> <name>hive.server2.thrift.port</name> <value>10000</value> <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</description> </property> <property> <name>hive.server2.thrift.http.port</name> <value>10001</value> <description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'http'.</description> </property> hive --service metastore &hive --service hiveserver2 & !connect jdbc:hive2://172.16.0.71:10000 create database tycybgongshang;describe database tycbygongshang;create database tycybzhuanli;set role admin;

优秀的个人博客,低调大师

Android内存控制

Android开发实践:检测App的内存占用和泄漏 http://www.linuxidc.com/Linux/2014-03/97563.htm 官方文档对于内存管理 http://developer.android.com/intl/zh-cn/training/articles/memory.html http://blog.csdn.net/hknock/article/details/47322005(中文翻译) Android代码内存优化建议-Android资源篇 http://blog.csdn.net/hknock/article/details/47322005 Android 内存管理 &Memory Leak & OOM 分析 http://blog.csdn.net/vshuang/article/details/39647167 ANDROID 探究oom内幕 http://blog.csdn.net/chengyingzhilian/article/details/8662849 Android DiskLruCache缓存完全解析 http://blog.csdn.net/lwyygydx/article/details/40401211 Java内存分配全面浅析 http://blog.csdn.net/yangyuankp/article/details/7651251 Java内存分配、管理小结 http://java-mzd.iteye.com/blog/848635 JVM 的 工作原理,层次结构 以及 GC工作原理 http://segmentfault.com/a/1190000002579346 前些日子,一位面试官(乔丽云,大约30来岁,个子不是很高),我从她那里确实领会了一些东西: 假如有这样一个需求,判断一个文件的格式 一般的人会将格式全部存入HashMap当中,然后去遍历,然后问我有没有什么优化的方法,就是不写 入到内存当中? 答案:用if else或switch来用语法来判断,这样是节省了内存,但是在性能上可能上会有一定的代价。 在Activity退出,注销登录时,如果还有网络请求在运行,应该怎么取消? Volley库可以做到 对于一些图片库,在下载完图片时,如果任务在进行,而界面退出了,应该怎么取消?图片库做了 什么处理? DiskLruCache详解 http://blog.csdn.net/lwyygydx/article/details/40401211 本文转自屠夫章哥 51CTO博客,原文链接:http://blog.51cto.com/4259297/1710264,如需转载请自行联系原作者

优秀的个人博客,低调大师

groovy–流程控制

在本篇文章中,我们将介绍逻辑分支,循环,以及如何从if-else以及try-catch代码块中返回值。 if – else Groovy 支持Java传统的if-else语法: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 def x = false def y = false if ( !x ) { x = true } assert x == true if ( x ) { x = false } else { y = true } assert x == y Groovy 也支持Java传统的if-else if -else 语法: 1 if( ... ) { 2 ... 3 }elseif(...) { 4 ... 5 }else{ 6 ... 7 } 三元操作符 Groovy 也支持Java传统的三元操作符: 1 defy =5 2 defx = (y >1) ?"worked":"failed" 3 assertx =="worked" switch Groovy也支持switch语句,不过和java的switch语句还是有很大的区别的: 1 defx =1.23 2 defresult ="" 3 4 switch( x ) { 5 case"foo": 6 result ="found foo" 7 // lets fall through 8 9 case"bar": 10 result +="bar" 11 12 case[4,5,6,'inList']: 13 result ="list" 14 break 15 16 case12..30: 17 result ="range" 18 break 19 20 caseInteger: 21 result ="integer" 22 break 23 24 caseNumber: 25 result ="number" 26 break 27 28 default: 29 result ="default" 30 } 31 32 assertresult =="number" 从上面的例子可以看出switch ( x )中的x可以使用任何类型的值,而且下面的匹配值也可以使用任何的类型。 循环 Groovy也支持Java传统的while循环语法: 1 defx =0 2 defy =5 3 4 while( y-- >0) { 5 x++ 6 } 7 8 assertx ==5 for循环 在Groovy中,for循环更加的简单,而且如果你愿意的话,你也可以在Groovy中使用标准的C/Java的for循环语法。 1 for (inti =0; i <5; i++) { 2 } 3 4 // iterate over a range 5 defx =0 6 for ( iin0..9) { 7 x += i 8 } 9 assertx ==45 10 11 // iterate over a list 12 x =0 13 for ( iin[0,1,2,3,4] ) { 14 x += i 15 } 16 assertx ==10 17 18 // iterate over an array 19 array = (0..4).toArray() 20 x =0 21 for ( iinarray ) { 22 x += i 23 } 24 assertx ==10 25 26 // iterate over a map 27 defmap = ['abc':1,'def':2,'xyz':3] 28 x =0 29 for ( einmap ) { 30 x += e.value 31 } 32 assertx ==6 33 34 // iterate over values in a map 35 x =0 36 for ( vinmap.values() ) { 37 x += v 38 } 39 assertx ==6 40 41 // iterate over the characters in a string 42 deftext ="abc" 43 deflist = [] 44 for (cintext) { 45 list.add(c) 46 } 47 assertlist == ["a","b","c"] 闭包(closures) 有时候你也可以使用闭包的each()和eachWithIndex()方法来替换一些for循环代码。 1 defstringList = ["java","perl","python","ruby","c#","cobol", 2 "groovy","jython","smalltalk","prolog","m","yacc"]; 3 4 defstringMap = ["Su":"Sunday","Mo":"Monday","Tu":"Tuesday", 5 "We":"Wednesday","Th":"Thursday","Fr":"Friday", 6 "Sa":"Saturday"]; 7 8 stringList.each() {print" ${it}"};println""; 9 // java perl python ruby c# cobol groovy jython smalltalk prolog m yacc 10 11 stringMap.each() { key, value ->println"${key} == ${value}"}; 12 // Su == Sunday 13 // We == Wednesday 14 // Mo == Monday 15 // Sa == Saturday 16 // Th == Thursday 17 // Tu == Tuesday 18 // Fr == Friday 19 20 stringList.eachWithIndex() { obj, i ->println" ${i}: ${obj}"}; 21 // 0: java 22 // 1: perl 23 // 2: python 24 // 3: ruby 25 // 4: c# 26 // 5: cobol 27 // 6: groovy 28 // 7: jython 29 // 8: smalltalk 30 // 9: prolog 31 // 10: m 32 // 11: yacc 33 34 stringMap.eachWithIndex() { obj, i ->println" ${i}: ${obj}"}; 35 // 0: Su=Sunday 36 // 1: We=Wednesday 37 // 2: Mo=Monday 38 // 3: Sa=Saturday 39 // 4: Th=Thursday 40 // 5: Tu=Tuesday 41 // 6: Fr=Friday 从if-else和try-catch代码块中返回值 从 Groovy 1.6开始,在方法或者闭包中的最后一行表达式,可以从if/else和try/catch/finally代码块中返回值,而且并不需要明确的使用return关键字返回值,只需要他们是代码块的最后一个表达式就行。 下面的例子就说明了这个情况,在下面的代码块中虽然没有显示的调用return关键字,但是仍然会返回1: 1 defmethod() { 2 if(true)1else0 3 } 4 5 assertmethod() ==1 对于 try/catch/finally blocks代码块来说,如果try代码块中没有抛出异常的话,那么try代码块的最后一行的表达式将会被返回,如果try的代码块抛出异常并且被catch住的时候,那么catch代码块中的最后一个表达式的值将会被返回。 但是请注意:finally代码块不会返回值的。 1 defmethod(bool) { 2 try{ 3 if(bool)thrownewException("foo") 4 1 5 }catch(e) { 6 2 7 }finally{ 8 3 9 } 10 } 11 12 assertmethod(false) ==1 13 assertmethod(true) ==2 ============================================================================== 本文转自被遗忘的博客园博客,原文链接:http://www.cnblogs.com/rollenholt/p/3349046.html,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册