首页 文章 精选 留言 我的

精选列表

搜索[reduce],共2637篇文章
优秀的个人博客,低调大师

远程提交Map/Reduce任务

1. 将开发好MR代码打包成jar。添加到distributed cache中。 Xml代码 bin/hadoopfs-copyFromLocal/root/stat-analysis-mapred-1.0-SNAPSHOT.jar/user/root/lib bin/hadoop fs -copyFromLocal /root/stat-analysis-mapred-1.0-SNAPSHOT.jar /user/root/lib 2. 在服务器端创建和你客户端一模一样的用户。创建目录 /tmp/hadoop-root/stagging/用户 3. 客户端提交job的代码 Java代码 Configurationconf=HBaseConfiguration.create(); conf.set("hbase.zookeeper.quorum","node.tracker1"); conf.set("fs.default.name","hdfs://node.tracker1:9000/hbase"); conf.set("mapred.job.tracker","node.tracker1:9001"); Jobjob=newJob(conf,"Hbase_FreqCounter1"); job.setJarByClass(FreqCounter1.class); Scanscan=newScan(); Stringcolumns="details";//commaseperated scan.addFamily(Bytes.toBytes(columns)); scan.setFilter(newFirstKeyOnlyFilter()); TableMapReduceUtil.initTableMapperJob("access_logs",scan,Mapper1.class,ImmutableBytesWritable.class, IntWritable.class,job); TableMapReduceUtil.initTableReducerJob("summary_user",Reducer1.class,job); /TableMapReduceUtil.addDependencyJars(job); DistributedCache.addFileToClassPath(newPath("hdfs://node.tracker1:9000/user/root/lib/stat-analysis-mapred-1.0-SNAPSHOT.jar"),job.getConfiguration()); job.submit(); Configuration conf = HBaseConfiguration.create(); conf.set("hbase.zookeeper.quorum", "node.tracker1"); conf.set("fs.default.name", "hdfs://node.tracker1:9000/hbase"); conf.set("mapred.job.tracker", "node.tracker1:9001"); Job job = new Job(conf, "Hbase_FreqCounter1"); job.setJarByClass(FreqCounter1.class); Scan scan = new Scan(); String columns = "details"; // comma seperated scan.addFamily(Bytes.toBytes(columns)); scan.setFilter(new FirstKeyOnlyFilter()); TableMapReduceUtil.initTableMapperJob("access_logs", scan, Mapper1.class, ImmutableBytesWritable.class, IntWritable.class, job); TableMapReduceUtil.initTableReducerJob("summary_user", Reducer1.class, job); // TableMapReduceUtil.addDependencyJars(job); DistributedCache.addFileToClassPath(new Path("hdfs://node.tracker1:9000/user/root/lib/stat-analysis-mapred-1.0-SNAPSHOT.jar"),job.getConfiguration()); job.submit(); 4.运行java application,登陆node的MR管理页面,可以看到

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

map-reduce任务的执行流程

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq1010885678/article/details/44657537 (1).客户端提交一个mr的jar包给JobClient(提交方式:hadoop jar ...) (2).JobClient通过RPC和JobTracker进行通信,返回一个存放jar包的地址(HDFS)和jobId (3).client将jar包写入到HDFS当中(path = hdfs上的地址 + jobId) (4).开始提交任务(任务的描述信息,不是jar, 包括jobid,jar存放的位置,配置信息等等) (5).JobTracker进行初始化任务 (6).读取HDFS上的要处理的文件,开始计算输入分片,每一个分片对应一个MapperTask (7).TaskTracker通过心跳机制领取任务(任务的描述信息) (8).下载所需的jar,配置文件等 (9).TaskTracker启动一个java child子进程,用来执行具体的任务(MapperTask或ReducerTask ) (10).将结果写入到HDFS当中

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

How to Reduce Token Cost for LLM Agents: A Practical Guide

If you've been building with LLM agents for a while, you've probably noticed the pattern: conversations grow, context windows fill up, and token costs climb steadily. A single long session can burn through more tokens than your first hundred short ones combined. This guide walks through practical strategies to cut token costs without sacrificing agent quality. ## Where Tokens Go |Source|Typical Share|Why It Grows| | --- | --- | --- | |Accumulated conversation history|40-60%|Every turn adds to the context| |Repeated context (docs, code snippets)|20-30%|Users re-paste what agents should already know| |Tool call results|10-20%|API responses and search results are verbose| ## Strategy 1: Conversation Summarization Periodically summarize older conversation turns and replace them with the summary. **Works when:** Single agent, manageable turn count. **Limitation:** Summarization can drop critical details — a constraint mentioned in turn 3 might vanish from the summary in turn 15. ## Strategy 2: Layered Memory with On-Demand Retrieval Instead of stuffing all history into context, use a layered memory system that stores at different granularities and retrieves only what's relevant. [TencentDB Agent Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory) implements this as a four-layer architecture: |Layer|Stores|Purpose| | --- | --- | --- | |L0 Conversation|Raw conversations with full context|Source verification| |L1 Atom|Extracted facts, preferences, constraints|Precise recall| |L2 Scenario|Knowledge blocks organized by project|Fast context recovery| |L3 Persona|Long-term user profile|Quick user understanding| Retrieval uses BM25 + vector search + RRF (Reciprocal Rank Fusion), with hard constraints on entry count, character budget, and timeout — so memory never blows up the context window. **Result:** Only relevant memory slices enter context, not the full history. ## Strategy 3: Structured Document and Code Indexing If agents repeatedly reference the same documents or codebase, stop pasting them. Index them once. TencentDB Agent Memory provides two structured index assets: - **Wiki**: Turns documents into structured pages with a link graph. Agents search and retrieve relevant sections instead of loading entire files. - **CodeGraph**: Indexes code symbols, files, call relationships, and impact paths. Agents can check "what does changing this function affect?" without loading the whole codebase. ## Strategy 4: Team-Level Memory Reuse When multiple agents serve the same team, each maintaining independent memory leads to redundant accumulation. TencentDB Agent Memory's team memory: one agent's validated Skill (e.g., "Release Checklist") gets reviewed, shared with the team, and equipped by other agents — no re-learning required. ## Quick Comparison |Strategy|Best For|Token Reduction|Setup Effort| | --- | --- | --- | --- | |Summarization|Single agent, quick fix|30-50%|Low| |Layered memory|Long-term|50-70%|Medium| |Doc/code indexing|Repeated reference|60-80%|Medium| |Team memory reuse|Multi-agent teams|Depends on reuse|Medium-high| On the PersonaMem benchmark, TencentDB Agent Memory improved agent user-understanding accuracy from 48% to 76% — compressing context without sacrificing quality. MIT licensed. One command to start: ``` git clone https://github.com/TencentCloud/TencentDB-Agent-Memory.git cd TencentDB-Agent-Memory/deploy/global-images ./start-all.sh ``` Repo: [https://github.com/TencentCloud/TencentDB-Agent-Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory)

资源下载

更多资源
腾讯云软件源

腾讯云软件源

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

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等操作系统。

用户登录
用户注册
修改密码
忘记密码