首页 文章 精选 留言 我的

精选列表

搜索[容器配置],共10000篇文章
优秀的个人博客,低调大师

阿里云E-MapReduce Pig 作业配置

E-MapReduce 中,用户申请集群的时候,默认为用户提供了 Pig 环境,用户可以直接使用 Pig 来创建和操作自己的表和数据。操作步骤如下。 1.用户需要提前准备好 Pig 的脚本,例如: /* 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.*/ -- Query Phrase Popularity (Hadoop cluster) -- This script processes a search query log file from the Excite search engine and finds search phrases that occur with particular high frequency during certain times of the day. -- Register the tutorial JAR file so that the included UDFs can be called in the script. REGISTER oss://emr/checklist/jars/chengtao/pig/tutorial.jar; -- Use the PigStorage function to load the excite log file into the “raw” bag as an array of records. -- Input: (user,time,query) raw = LOAD 'oss://emr/checklist/data/chengtao/pig/excite.log.bz2' USING PigStorage('t') AS (user, time, query); -- Call the NonURLDetector UDF to remove records if the query field is empty or a URL. clean1 = FILTER raw BY org.apache.pig.tutorial.NonURLDetector(query); -- Call the ToLower UDF to change the query field to lowercase. clean2 = FOREACH clean1 GENERATE user, time, org.apache.pig.tutorial.ToLower(query) as query; -- Because the log file only contains queries for a single day, we are only interested in the hour. -- The excite query log timestamp format is YYMMDDHHMMSS. -- Call the ExtractHour UDF to extract the hour (HH) from the time field. houred = FOREACH clean2 GENERATE user, org.apache.pig.tutorial.ExtractHour(time) as hour, query; -- Call the NGramGenerator UDF to compose the n-grams of the query. ngramed1 = FOREACH houred GENERATE user, hour, flatten(org.apache.pig.tutorial.NGramGenerator(query)) as ngram; -- Use the DISTINCT command to get the unique n-grams for all records. ngramed2 = DISTINCT ngramed1; -- Use the GROUP command to group records by n-gram and hour. hour_frequency1 = GROUP ngramed2 BY (ngram, hour); -- Use the COUNT function to get the count (occurrences) of each n-gram. hour_frequency2 = FOREACH hour_frequency1 GENERATE flatten($0), COUNT($1) as count; -- Use the GROUP command to group records by n-gram only. -- Each group now corresponds to a distinct n-gram and has the count for each hour. uniq_frequency1 = GROUP hour_frequency2 BY group::ngram; -- For each group, identify the hour in which this n-gram is used with a particularly high frequency. -- Call the ScoreGenerator UDF to calculate a "popularity" score for the n-gram. uniq_frequency2 = FOREACH uniq_frequency1 GENERATE flatten($0), flatten(org.apache.pig.tutorial.ScoreGenerator($1)); -- Use the FOREACH-GENERATE command to assign names to the fields. uniq_frequency3 = FOREACH uniq_frequency2 GENERATE $1 as hour, $0 as ngram, $2 as score, $3 as count, $4 as mean; -- Use the FILTER command to move all records with a score less than or equal to 2.0. filtered_uniq_frequency = FILTER uniq_frequency3 BY score > 2.0; -- Use the ORDER command to sort the remaining records by hour and score. ordered_uniq_frequency = ORDER filtered_uniq_frequency BY hour, score; -- Use the PigStorage function to store the results. -- Output: (hour, n-gram, score, count, average_counts_among_all_hours) STORE ordered_uniq_frequency INTO 'oss://emr/checklist/data/chengtao/pig/script1-hadoop-results' USING PigStorage(); 2.将该脚本保存到一个脚本文件中,例如叫 script1-hadoop-oss.pig,然后将该脚本上传到 OSS 的某个目录中(例如:oss://path/to/script1-hadoop-oss.pig)。 3.进入阿里云 E-MapReduce 控制台作业列表。 4.单击该页右上角的创建作业,进入创建作业页面。 5.填写作业名称。 6.选择 Pig 作业类型,表示创建的作业是一个 Pig 作业。这种类型的作业,其后台实际上是通过以下的方式提交。 `pig [user provided parameters]` 7.在应用参数选项框中填入 Pig 命令后续的参数。例如,如果需要使用刚刚上传到 OSS 的 Pig 脚本,则填写如下: `-x mapreduce ossref://emr/checklist/jars/chengtao/pig/script1-hadoop-oss.pig` 您也可以单击选择 OSS 路径,从 OSS 中进行浏览和选择,系统会自动补齐 OSS 上 Pig 脚本的绝对路径。请务必将 Pig 脚本的前缀修改为 ossref(单击切换资源类型),以保证 E-MapReduce 可以正确下载该文件。 8.选择执行失败后策略。

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

阿里云E-MapReduce Spark 作业配置

1.进入阿里云 E-MapReduce 控制台作业列表。 2.单击该页右上角的创建作业,进入创建作业页面。 3.填写作业名称。 4.选择 Spark 作业类型,表示创建的作业是一个 Spark 作业。Spark 作业在 E-MapReduce 后台使用以下的方式提交: spark-submit [options] --class [MainClass] xxx.jar args5.在应用参数选项框中填写提交该 Spark 作业需要的命令行参数。请注意,应用参数框中只需要填写“spark-submit”之后的参数即可。以下分别示例如何填写创建 Spark 作业和 pyspark 作业的参数。 创建 Spark 作业 新建一个 Spark WordCount 作业。 作业名称: Wordcount 类型:选择 Spark 应用参数: 在命令行下完整的提交命令是: spark-submit --master yarn-client --driver-memory 7G --executor-memory 5G --executor-cores 1 --num-executors 32 --class com.aliyun.emr.checklist.benchmark.SparkWordCount emr-checklist_2.10-0.1.0.jar oss://emr/checklist/data/wc oss://emr/checklist/data/wc-counts 32 在 E-MapReduce 作业的应用参数框中只需要填写: --master yarn-client --driver-memory 7G --executor-memory 5G --executor-cores 1 --num-executors 32 --class com.aliyun.emr.checklist.benchmark.SparkWordCount ossref://emr/checklist/jars/emr-checklist_2.10-0.1.0.jar oss://emr/checklist/data/wc oss://emr/checklist/data/wc-counts 32 需要注意的是:作业 Jar 包保存在 OSS 中,引用这个 Jar 包的方式是 ossref://emr/checklist/jars/emr-checklist_2.10-0.1.0.jar。您可以单击选择 OSS 路径,从 OSS 中进行浏览和选择,系统会自动补齐 OSS 上 Spark 脚本的绝对路径。请务必将默认的“oss”协议切换成“ossref”协议。 创建 pyspark 作业 E-MapReduce 除了支持 Scala 或者 Java 类型作业外,还支持 python 类型 Spark 作业。以下新建一个 python 脚本的 Spark Kmeans 作业。 作业名称:Python-Kmeans 类型:Spark 应用参数: --master yarn-client --driver-memory 7g --num-executors 10 --executor-memory 5g --executor-cores 1 ossref://emr/checklist/python/kmeans.py oss://emr/checklist/data/kddb 5 32 支持 Python 脚本资源的引用,同样使用“ossref”协议。 pyspark 目前不支持在线安装 Python 工具包。 6选择执行失败后策略。 7.单击确定,Spark 作业即定义完成。

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

阿里云E-MapReduce Hive 作业配置

E-MapReduce 中,用户申请集群的时候,默认为用户提供了 Hive 环境,用户可以直接使用 Hive 来创建和操作自己的表和数据。操作步骤如下。 1.用户需要提前准备好 Hive SQL 的脚本,例如: USE DEFAULT; DROP TABLE uservisits; CREATE EXTERNAL TABLE IF NOT EXISTS uservisits (sourceIP STRING,destURL STRING,visitDate STRING,adRevenue DOUBLE,user Agent STRING,countryCode STRING,languageCode STRING,searchWord STRING,duration INT ) ROW FORMAT DELIMITED FIELDS TERMI NATED BY ',' STORED AS SEQUENCEFILE LOCATION '/HiBench/Aggregation/Input/uservisits'; DROP TABLE uservisits_aggre; CREATE EXTERNAL TABLE IF NOT EXISTS uservisits_aggre ( sourceIP STRING, sumAdRevenue DOUBLE) STORED AS SEQUENCEFILE LO CATION '/HiBench/Aggregation/Output/uservisits_aggre'; INSERT OVERWRITE TABLE uservisits_aggre SELECT sourceIP, SUM(adRevenue) FROM uservisits GROUP BY sourceIP; 2.将该脚本保存到一个脚本文件中,例如叫 uservisits_aggre_hdfs.hive,然后将该脚本上传到 OSS 的某个目录中(例如:oss://path/to/uservisits_aggre_hdfs.hive)。 3.登录阿里云 E-MapReduce 控制台作业列表。 4.单击该页右上角的创建作业,进入创建作业页面。 5.填写作业名称。 6.选择 Hive 作业类型,表示创建的作业是一个 Hive 作业。这种类型的作业,其后台实际上是通过以下的方式提交。 hive [user provided parameters]7.在应用参数选项框中填入 Hive 命令后续的参数。例如,如果需要使用刚刚上传到 OSS 的 Hive 脚本,则填写的内容如下: -f ossref://path/to/uservisits_aggre_hdfs.hive您也可以单击选择 OSS 路径,从 OSS 中进行浏览和选择,系统会自动补齐 OSS 上 Hive 脚本的绝对路径。请务必将 Hive 脚本的前缀修改为 ossref(单击切换资源类型),以保证 E-MapReduce 可以正确下载该文件。 8.选择执行失败后策略。 9.单击确定,Hive 作业即定义完成。

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

[Android Pro] proguard.cfg 配置文件

转载自:http://my.oschina.net/zhangzhihao/blog/72393 # ------------------------------------- # android 原始混淆模板 # ------------------------------------- # ---------------------------------- # 通过指定数量的优化能执行 # -optimizationpasses n # ---------------------------------- -optimizationpasses 5 # ---------------------------------- # 混淆时不会产生形形色色的类名 # -dontusemixedcaseclassnames # ---------------------------------- #-dontusemixedcaseclassnames # ---------------------------------- # 指定不去忽略非公共的库类 # -dontskipnonpubliclibraryclasses # ---------------------------------- #-dontskipnonpubliclibraryclasses # ---------------------------------- # 不预校验 # -dontpreverify # ---------------------------------- # -dontpreverify # ---------------------------------- # 输出生成信息 # -verbose # ---------------------------------- -verbose # ---------------------------------- # 优化选项 # optimizations {optimization_filter} # ---------------------------------- -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public class com.android.vending.licensing.ILicensingService -keepclasseswithmembernames class * { native <methods>; } # ----------------- # modify 修改合并 # ----------------- -keep public class * extends android.view.View { public <init>(android.content.Context); public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet, int); public void set*(...); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } #-------------------------- # 保护类型 -keepattributes 说明 # Exceptions, Signature, Deprecated, SourceFile, SourceDir, LineNumberTable, LocalVariableTable, # LocalVariableTypeTable, Synthetic, EnclosingMethod, RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations, # RuntimeVisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations, and AnnotationDefault # -------------------- -keepattributes ** -libraryjars <java.home>/lib/rt.jar # ---------------------- # 不压缩指定的文件 # -dontshrink # ---------------------- -dontshrink # ---------------------- # 不优化指定的文件 # -dontoptimize # ----------------------- -dontoptimize # ----------------------- # 不混淆指定的文件 # -dontobfuscate # ----------------------- # ----- 混淆包路径 ------- -repackageclasses '' -flattenpackagehierarchy '' -target 1.6 # -------- 以下是使用了 roboguice-1.1.2.jar 以及 guice-2.0-no_app.jar 功能需要保护的字段及类相关 -------- -keep class com.google.inject.Binder -keepclassmembers class * { @com.google.inject.Inject <init>(...); } -keepclassmembers class * { void *(**On*Event); } -keepclassmembers class **.R$* { public static <fields>; } # ------ 编译时需要用到的 jar 包 -libraryjars D:/dev_rc/android-sdk-windows/add-ons/addon_google_apis_google_inc_11/libs/maps.jar # ------ 保护 谷歌第三方 jar 包,界面特效 ---------- -keep class android.support.v4.** -dontwarn android.support.v4.** # ------ 保护百度地址jar包 -------- -keep class com.baidu.mapapi.** { *; } -dontwarn com.baidu.mapapi.** # --- 打包时忽略以下类的警告 -- -dontwarn com.classpackage.AA #-keepnames class * implements java.io.Serializable # ---------保护所有实体中的字段名称---------- -keepclassmembers class * implements java.io.Serializable { <fields>; } # --------- 保护类中的所有方法名 ------------ -keepclassmembers class * { public <methods>; } 分类: Android Pro 本文转自demoblog博客园博客,原文链接http://www.cnblogs.com/0616--ataozhijia/p/4639007.html如需转载请自行联系原作者 demoblog

资源下载

更多资源
腾讯云软件源

腾讯云软件源

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

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

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部分的功能。

用户登录
用户注册