首页 文章 精选 留言 我的

精选列表

搜索[列状态],共10017篇文章
优秀的个人博客,低调大师

用web查看hadoop运行状态

我们安装完hadoop,下面我们从视觉上看看hadoop怎么玩的。 我们可以在win7系统上,通过web界面,在浏览器地址栏输入地址,直接查看hadoop的运行情况; 10.10.11.191:50030 这个里面,我们可以看到Map/Reduce的管理情况 10.10.11.191:50070 这里可以看到HDFS的管理情况。 但是在这里,会有一个问题。 问题:点击上图中,红框锁定的链接,Browser the filesystem,打不开界面。这是什么情况呢? 点击Live Nodes,进入如下界面: 点击host2,同样打不开界面…… host2对应的ip为10.10.11.192 而链接地址为host2:50070/browseDirectory.jsp?namenodeInfoPort=50070&dir=%2F 直接访问的host2主机地址。 很明显,出现这种状况的原因是win7电脑,并不知道host2是谁,所以需要在win7电脑的hosts文件中,添加上host2,host3,host4,master主机和ip地址的映射 win7系统,hosts文件位置:C:\Windows\System32\drivers\etc 在win7电脑上,添加完hosts配置,我们就可以解决上面的问题了。host2也就可以访问了。如下 摘自http://www.cnblogs.com/laov/p/3433994.html 本文转自茄子_2008博客园博客,原文链接:http://www.cnblogs.com/xd502djj/p/4241111.html,如需转载请自行联系原作者。

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

Android 监听手机GPS打开状态

转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/70854942 本文出自【赵彦军的博客】 GPS_Presenter package com.yiba.core; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.location.LocationManager; /** * Created by ${zhaoyanjun} on 2017/3/29. * GPS 开关监听 */ public class GPS_Presenter { private Context mContext ; private Receiver receiver ; private GPS_Interface mInterface ; private String GPS_ACTION = "android.location.PROVIDERS_CHANGED" ; public GPS_Presenter(Context context , GPS_Interface mInterface ){ this.mContext = context ; this.mInterface = mInterface ; observeWifiSwitch(); } private void observeWifiSwitch(){ IntentFilter filter = new IntentFilter(); filter.addAction( GPS_ACTION ); receiver = new Receiver() ; mContext.registerReceiver(receiver, filter); } /** * 释放资源 */ public void onDestroy(){ if ( receiver != null ){ mContext.unregisterReceiver( receiver ); } if (mContext!=null){ mContext = null; } } class Receiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().matches( GPS_ACTION )) { if ( mInterface != null ){ mInterface.gpsSwitchState( gpsIsOpen( context )); } } } } /** * 判断GPS是否开启,GPS或者AGPS开启一个就认为是开启的 * @param context * @return true 表示开启 */ public boolean gpsIsOpen(final Context context) { LocationManager locationManager = (LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE); // 通过GPS卫星定位,定位级别可以精确到街(通过24颗卫星定位,在室外和空旷的地方定位准确、速度快) boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); // 通过WLAN或移动网络(3G/2G)确定的位置(也称作AGPS,辅助GPS定位。主要用于在室内或遮盖物(建筑群或茂密的深林等)密集的地方定位) boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); if (gps || network) { return true; } return false; } } GPS_Interface 回调接口 package com.yiba.core; /** * Created by ${zhaoyanjun} on 2017/3/29. * gps 开关监听 */ public interface GPS_Interface { void gpsSwitchState( boolean gpsOpen ); } 在 Activity 中使用 package com.yiba.core; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; public class MainActivity extends AppCompatActivity implements GPS_Interface { private GPS_Presenter gps_presenter ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); gps_presenter = new GPS_Presenter( this , this ) ; } @Override protected void onDestroy() { super.onDestroy(); //释放资源 if ( gps_presenter != null ){ gps_presenter.onDestroy(); } } @Override public void gpsSwitchState(boolean gpsOpen) { if ( gpsOpen ){ Toast.makeText(this, " 手机GPS 打开", Toast.LENGTH_SHORT).show(); }else { Toast.makeText(this, " 手机GPS 关闭", Toast.LENGTH_SHORT).show(); } } }

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

ES doc_values介绍——本质是field value的列存储,做聚合分析用,ES默认开启,会占用存储空间(列存储压缩技巧,除公共除...

doc_values Doc values are the on-disk data structure, built at document index time, which makes this data access pattern possible.They store the same values as the_sourcebut in a column-oriented fashion that is way more efficient for sorting and aggregations.(本质!!!)Doc values are supported on almost all field types, with thenotable exception ofanalyzedstring fields. All fields which support doc values have themenabled by default. If you are sure thatyou don’t need to sort or aggregate on a field, or access the field value from a script, you can disable doc values in order to save disk space: PUT my_index { "mappings": { "my_type": { "properties": { "status_code": { "type": "keyword" }, "session_id": { "type": "keyword", "doc_values": false } } } } } Thestatus_codefield hasdoc_valuesenabled by default. Thesession_idhasdoc_valuesdisabled, but can still be queried. 摘自:https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html Column-store compression edit At a high level, doc values are essentially a serializedcolumn-store. As we discussed in the last section, column-stores excel at certain operations because the data is naturally laid out in a fashion that is amenable to those queries. But they also excel at compressing data, particularly numbers. This is important for both saving space on diskandfor faster access. Modern CPU’s are many orders of magnitude faster than disk drives (although the gap is narrowing quickly with upcoming NVMe drives). That means it is often advantageous to minimize the amount of data that must be read from disk, even if it requires extra CPU cycles to decompress. To see how it can help compression, take this set of doc values for a numeric field: Doc Terms ----------------------------------------------------------------- Doc_1 | 100 Doc_2 | 1000 Doc_3 | 1500 Doc_4 | 1200 Doc_5 | 300 Doc_6 | 1900 Doc_7 | 4200 ----------------------------------------------------------------- Thecolumn-stride layout means we have a contiguous block of numbers:[100,1000,1500,1200,300,1900,4200]. xxx Doc values use several tricks like this. In order, the following compression schemes are checked: If all values are identical (or missing), set a flag and record the value If there are fewer than 256 values, a simple table encoding is used If there are > 256 values, check to see if there is a common divisor If there is no common divisor, encode everything as an offset from the smallest value You’ll note that these compression schemes are not "traditional" general purpose compression like DEFLATE or LZ4.Because the structure of column-stores are rigid and well-defined, we can achieve higher compression by using specialized schemes rather than the more general compression algorithms like LZ4. You may be thinking"Well that’s great for numbers, but what about strings?"Strings are encoded similarly, with the help of an ordinal table. The strings are de-duplicated and sorted into a table, assigned an ID, and then those ID’s are used as numeric doc values.Which means strings enjoy many of the same compression benefits that numerics do. The ordinal table itself has some compression tricks, such as using fixed, variable or prefix-encoded strings. 摘自:https://www.elastic.co/guide/en/elasticsearch/guide/current/_deep_dive_on_doc_values.html 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6401466.html,如需转载请自行联系原作者

资源下载

更多资源
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文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册