Develop an Ajax-based file upload portlet using DWR

Apache SkyWalking 部署与接入实践:版本、端口、Agent 与常见误区(Windows 本地测试 + Linux 生产参考) 本文梳理SkyWalking本地测试与生产部署关键点,澄清组件关系与常见误区:OAP、UI、存储、JavaAgent为独立组件,11.0.0起移除旧版BoosterUI;BanyanDB为默认存储,需先于OAP启动且版本匹配;端口职责明确(如11800为Agent gRPC上报端口);新版HorizonUI需手动配置用户及Argon2id哈希密码;部署顺序为BanyanDB→OAP→UI,Agent仅连接OAP 11800端口。建议生产环境使用Docker/K8s,严格配置安全与兼容性。 阅读详情

        File upload is a basic function of today's Web portals. In this article, authors Xiaobo Yang and Rob Allan describe how to develop an Ajax-based file upload JSR 168-compliant portlet using DWR (Direct Web Remoting). DWR is an ideal Ajax framework for Java™ developers that dynamically generates JavaScript based on server-side deployed Java classes. You will learn how you can use DWR to retrieve file upload progress from the portal server.

Introduction

Web portals provide users a central gateway for accessing various resources and services. At the same time, they provide users a platform for contributing resources to be shared with other users. Users might share anything from photos to audio and video files to scientific datasets for research use. Therefore, file upload is a basic and necessary function of Web portals.

Today's Web portals are heavily based on Java portlet technology. While progress bars for file upload have been described by various developers using Ajax, we have yet to discover one that is portlet based. This article shows how to develop an Ajax-based file upload portlet that displays a progress bar during the file upload process. This portlet is particularly useful for those who need to share large audio, video, and scientific files.

To follow this article, you should be familiar with Web development using Java Servlets and JavaServer Pages (JSPs). Also, it is essential that you understand portal and portlet technology development. However, if you are not proficient with portlet technology, don't abandon the article now because you'll find a brief introduction to portlet technology as well as useful resources you can use to help you get up to speed.

 

Consider experimenting with one of the JSR 168-compliant portal frameworks, such as IBM® WebSphere® Portal Server, Apache Pluto, eXo platform, or Liferay Portal before testing the file upload portlet described in this article. We used Apache Pluto 1.0.1, the JDK 5.0 Update 10, and Apache Ant Version 1.6.5 during the process of developing this article.

Basic concepts of portlets

In general, portlets can be treated as Web components. Portlets are similar to servlets, but they focus on the presentation layer of your application. Typical output of a portlet is HTML fragments that can then be assembled by a Web portal. Portlets themselves are managed by a portlet container. The main features of portlets include:

  • Multiple modes: A portlet can have different views under different modes. For example, besides the view mode, a portlet can support the edit mode so that users can set their own preferences.
  • Multiple window states: A portlet can be minimized, maximized, and so on.
  • Customizable parameters: A portlet can define parameters, which are customizable by users.

To get more detailed information on portlets, refer to the Java Portlet Specification 1.0, JSR 168. (JSR 286, the successor to JSR 168, is due to be released in late 2007, with improvements such as inter-portlet communication and a portlet filter.) See Resources for links to this information.

Steps to get started with the file upload portlet

The cornerstone of your file upload portlet is the Apache Commons FileUpload package (also referred to as FileUpload in this article). In addition to file upload support in a servlet, the Apache Commons FileUpload Version 1.1 package supports file upload in a portlet as well. This article uses Apache Commons FileUpload Version 1.2.

Basically, you need to perform two steps to develop a file upload progress bar:

  1. Server side retrieval of file upload progress
  2. Client side retrieval and display of the upload progress from the portal server

 

Server side retrieval of file upload progress

The FileUpload package supports using a listener to retrieve file upload progress. In the doUpload() method of the file upload portlet (named uk.ac.dl.esc.gtg.myportlets.fileupload.FileUploadPortlet in the source files included in the Download area of this article), we set such a progress listener for PortletFileUpload by calling the setProgressListener() method as shown in Listing 1:


Listing 1. Set a progress listener for the file upload package

                
DiskFileItemFactory factory = new DiskFileItemFactory();
PortletFileUpload pfu = new PortletFileUpload(factory);
pfu.setSizeMax(uploadMaxSize); // Maximum upload size
pfu.setProgressListener(new FileUploadProgressListener());
            

FileUploadProgressListener (see Listing 2) is a listener that implements the org.apache.commons.fileupload.ProgressListener interface. The update() method is called automatically by the FileUpload package to refresh the latest information about how many bytes are transferred. In this article's implementation, progress is updated when every 10KB of data are transferred. This prevents progress updates from occurring too frequently. The getFileUploadStatus() method is used to calculate the current file upload progress, which will be called by the client using DWR (to be discussed in the next section).


Listing 2. File upload listener for retrieving file upload progress

                
package uk.ac.dl.esc.gtg.myportlets.fileupload;

import java.text.NumberFormat;

import org.apache.commons.fileupload.ProgressListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class FileUploadProgressListener implements ProgressListener {
	private static Log log = LogFactory.getLog(FileUploadProgressListener.class);

	private static long bytesTransferred = 0;

	private static long fileSize = -100;

	private long tenKBRead = -1;

	public FileUploadProgressListener() {
	}

	public String getFileUploadStatus() {
		// per looks like 0% - 100%, remove % before submission
		String per = NumberFormat.getPercentInstance().format(
				(double) bytesTransferred / (double) fileSize);
		return per.substring(0, per.length() - 1);
	}

	public void update(long bytesRead, long contentLength, int items) {
		// update bytesTransferred and fileSize (if required) every 10 KB is
		// read
		long tenKB = bytesRead / 10240;
		if (tenKBRead == tenKB)
			return;
		tenKBRead = tenKB;

		bytesTransferred = bytesRead;
		if (fileSize != contentLength)
			fileSize = contentLength;
	}

}
      

Client-side retrieval of file upload progress

Communication between the server and the client on file upload progress is realized using Ajax. We chose Direct Web Remoting (DWR) to provide Ajax support in our portlet. DWR is an ideal framework for Java developers to use to bring Ajax into the Web development processes because it allows JavaScript in a browser to interact with server-side Java objects. To use DWR in our portlet, the following steps are required (for more information about how to configure DWR, see Resources):

 

  • Configure DwrServlet through WEB-INF/web.xml (see Listing 3).
  • Define one or more server-side objects in WEB-INF/dwr.xml for the client to communicate. In Listing 4, FileUploadProgressListener is defined for DWR so that the client can call this auto-generated JavaScript. Also, only the getFileUploadStatus method is allowed to be called by the client. The other public method, update, is not allowed to be accessed (see Listing 2).
  • Include DWR-related JavaScript code in fileupload-view.jsp (see Listing 5).
  • Include the DWR library in our portlet application.


Listing 3. Configuration of DwrServlet in WEB-INF/web.xml

                
<!-- DWR servlet -->
  <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <display-name>DWR Servlet</display-name>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>false</param-value>
    </init-param>
  </servlet>

<!-- DWR servlet mapping -->
  <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-patter>
  </servlet-mappin>
  


Listing 4. WEB-INF/dwr.xml
                
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
                     "http://getahead.org/dwr//dwr20.dtd">

<dwr>
  <allow>
    <create creator="new" javascript="FileUploadProgressListener">
      <param name="class"
             value="uk.ac.dl.esc.gtg.myportlets.fileupload.FileUploadProgressListener"/>
      <include method="getFileUploadStatus"/>
    </create>
  </allow>
</dwr>
  

The JSP file, fileupload-view.jsp, is shown in Listing 5 to illustrate how DWR helps to retrieve file upload progress from the server side. Once a file is selected and the Upload button (see Figure 1) is clicked, the fileupload_ajax_query_upload_status() method is called after one second. This method then calls the getFileUploadStatus() method of FileUploadProgressListener (see Listing 2) in asynchronous mode. Herein lies the beauty of DWR: The client is communicating with the server-side Java object. Once a response is received, the fileupload_ajax_show_upload_status() method is called to refresh the progress. If the file upload is not accomplished, an updated progress is retrieved after two seconds.


Listing 5. File upload portlet JSP file -- fileupload-view.jsp

                
<%@ page session="false" %>
<%@ page contentType="text/html" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>

<script type="text/javascript"
        src='<%= renderResponse.encodeURL(renderRequest.getContextPath()
				+ "/dwr/interface/FileUploadProgressListener.js") %>'> 
</script>

<script type="text/javascript"
        src='<%= renderResponse.encodeURL(renderRequest.getContextPath()
				+ "/dwr/engine.js") %>'> 
</script>

<script type="text/javascript"
        src='<%= renderResponse.encodeURL(renderRequest.getContextPath()
				+ "/dwr/util.js") %>'> 
</script>

<script type="text/javascript">
  function fileupload_ajax_query_upload_status() {
    FileUploadProgressListener.getFileUploadStatus

                 (fileupload_ajax_show_upload_status);
    return true;
  }

  function fileupload_ajax_show_upload_status(status) {
    if (status == "100")
      document.getElementById("fileupload_progress").innerHTML
                                       ="File successfully uploaded";
    else {
      document.getElementById("progressBar").style.display = "block";
      document.getElementById("fileupload_progress").innerHTML=
                                       "Uploading file: " + status
                                       + "% completed, please wait...";
      document.getElementById("progressBarBoxContent").style.width =
                                       parseInt(status * 3.5) + "px";
      setTimeout(fileupload_ajax_query_upload_status, 2000);
    }

    return true;
  }
</script>

<style type="text/css">
  #progressBar {padding-top: 5px;}
  #progressBarBox {width: 350px; height: 20px; border: 1px insert; background: #eee;}
  #progressBarBoxContent {width: 0; height: 20px; border-right: 1px solid #444;
                                       background: #9ACB34;}
</style>

<h4>File Upload</h4>

<!-- the upload form -->
<% PortletURL pUrl = renderResponse.createActionURL();
 %>
<form action="<%= pUrl.toString() %>"
         enctype="multipart/form-data" method="post"
	 οnsubmit="setTimeout('fileupload_ajax_query_upload_status()', 1000)">
	 
  <input type="file" name="fileupload_upload" value="Upload File">
  <input type="submit" value="Upload">
</form>

<%-- file upload progress bar --%>
<div id="fileupload_progress"></div>
<div id="progressBar" style="display: none;">
  <div id="progressBarBoxContent"></div>
</div>
      

Deploy and test the file upload portlet with Apache Pluto

The next step in the process is to deploy and test the file upload portlet with Apache Pluto 1.0.1. (Note: The binary version was used in this article.)

Code compilation and deployment

An Ant script is provided within the downloadable portlet source code included with this article so that you can compile the portlet and build up the .war file for deployment. First, you must copy the following library files to the lib directory under the root of the source code:

  • commons-fileupload-1.2/commons-fileupload-1.2.jar
  • commons-io-1.3/commons-io-1.3.jar
  • commons-logging-1.0.4/commons-logging-1.0.4.jar
  • dwr-2.0.1/dwr.jar
  • portletapi-1.0/portlet.jar
  • servletapi-2.4/servletapi-2.4.jar

Now you're ready to run ant build and ant war to compile the code and build up the .war file for deployment accordingly. If everything goes as planned, you will find myportlets-fileupload.war under the dist directory. Follow these steps to deploy the portlet using Apache Pluto 1.0.1:

  1. Start Apache Tomcat and access http://localhost:8080/pluto/portal.
  2. Click the Admin link on the left side of the Pluto screen to deploy the portlet.
  3. Locate myportlets-fileupload.war and then click Submit.
  4. Define a portlet title, description, and layout, and then click Submit.
  5. Click Submit again on the page that is displayed.

You are now asked to either restart Tomcat or click the link Hot deploy myportlets-fileupload portlet application. We suggest you click the link Hot deploy myportlets-fileupload portlet application. The portlet is then loaded as shown in Figure 1:


Figure 1. File upload portlet running in Apache Pluto
FileUpload portlet

Test the file upload portlet

Once the portlet is deployed, you are ready to upload a file. To get the progress bar displayed, you should access the portlet from a computer other than your portal server. To upload a file, do the following:

  1. Click the Browse... button to select a file for uploading.
  2. Click the Upload button to upload the selected file. During file upload, the progress bar is displayed and updated (see Figure 2).

If you want to test the portlet from the same computer where Pluto is installed, you won't be able to see the progress bar because the maximum upload size is set to 20MB. You can change the upload size by altering fileupload_upload_maxsize within the WEB-INF/portlet.xml file.


Figure 2. A file being uploaded within the file upload portlet
File upload portlet uploading a file

In our portlet, the uploaded file is saved as a disk file under java.io.tmpdir -- for example, temp under $PLUTO_HOME or $CATALINA_HOME. Keep in mind that in actual Web applications, further processing might be required. For example, the uploaded file may be stored in a database for future usage; if it is an image file, it may be displayed in a Web browser.

 

Other applications for this technique

The technique in this article has been successfully applied to a file transfer portlet that makes use of the GridFTP protocol for managing large datasets between two third-party data grid nodes.

Summary

This article demonstrated how to use Ajax to develop a file upload portlet to display a progress bar. You learned about server side retrieval of file upload progress using a progress listener, client-side retrieval of file upload progress using DWR from the portal server, and rendering the progress bar to end users. This portlet is especially useful for sharing large datasets like audio and video files and scientific data. It has also demonstrated the ease of use of DWR to bring Ajax support to JSR 168 portlets.

利用WebDAV协议将百度网盘挂载为本地网络硬盘的完整指南 WebDAV是一种基于HTTP/HTTPS的扩展协议,它允许客户端通过标准HTTP方法对远程服务器上的文件进行读写和管理。其核心原理是通过定义如PROPFIND、PUT、GET等标准化方法,实现跨平台的远程文件系统访问。这项技术的价值在于打破了不同存储服务间的壁垒,将封闭的云存储生态接入开放标准协议体系。在工程实践中,WebDAV常被用于实现跨设备文件同步、媒体服务器集成和生产力工具数据备份等场景。通过搭建WebDAV服务器作为协议转换层,可以将百度网盘这类封闭存储服务映射为标准网络存储,实现类似bdpan 阅读详情

相关推荐

从ATE到ATPG:基于Scan Chain的芯片制造缺陷定位实战解析

本文深入解析了从ATE到ATPG的芯片制造缺陷定位实战技术,重点介绍了Scan Chain的工作原理、异步复位触发器处理技巧以及Design Compiler中的DFT实现方法。通过实际案例展示了如何利用ATE测试数据和ATPG工具进行精确的缺陷定位,并分享了提升测试覆盖率和优化测试成本的专业技巧,为芯片测试工程师提供了宝贵的实战经验。

weixin_42527160的博客 386

php max_file_upload,文件上传-PHP文件上传大于upload_max_filesize,并且出现错误

如何在上传到Web服务器的文件大于php upload_max_filesize时发现错误?我的问题类似于so/large-file-upload-errors-with-php,尽管我的内存限制设置为512M,所以该问题使用的分辨率对我没有帮助.例如,我尝试上传6.9MB的文件,而我的upload_max_filesize = 6M.我的脚本基本上只是停止执行,而我不知道在哪里或为什么.另外,我...

weixin_35733790的博客 749

Silly Tavern(酒馆)AI 角色扮演下载与安装教程(Windows本地部署)

SillyTavern是一款开源AI角色扮演前端工具,支持沉浸式对话和长期角色互动。本文详细介绍了在Windows系统F盘部署SillyTavern的完整流程,包括下载项目、安装Node.js和Git环境、配置路径、启动服务等关键步骤,并特别说明非系统盘路径可能遇到的npm安装问题及解决方法。成功启动后,用户可通过浏览器访问本地地址使用该工具进行AI角色扮演互动。

Tan3851的博客 1万+

Spark 和 Flink 挤在一个 YARN 队列里:一次容器超限把实时任务打挂之后

这次事故之后我最大的改变是:不再把"集群资源不够"当成扩容的理由。96 核的集群,离线队列平均利用率不到 40%,实时队列却被打挂,问题从来不是总量,是边界。隔离靠队列,稳定靠不抢实时,容量按峰值留而不是按平均算。如果你们也是 Spark 和 Flink 共用一个 YARN,先去看一眼实时队列有没有,这一个配置能省掉很多凌晨的电话。

编程技术探索者,分享C/C++、C#、Java、数据库等开发经验,聚焦实战技巧与AI兴趣,助力编程爱好者成长。 259

安卓手机部署酒馆 SillyTavern 全攻略(Termux 本地安装教程)

本文详细介绍了如何在安卓手机上通过 Termux 环境本地部署 SillyTavern,一个功能丰富的角色扮演对话 AI。步骤包括安装 Termux、Git,克隆 SillyTavern 仓库,安装 Node.js 和依赖,启动 SillyTavern,以及可选的高阶玩法——安装 TAI-Extras 扩展模块。文章还提供了常见问题的解决方案和优化技巧,如更新 SillyTavern、处理报错、文件访问、添加快捷命令和禁用安卓后台进程杀死。通过本教程,用户可以在安卓手机上体验本地部署的 AI 对话,享受更高

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1万+

在RStudio中使用GitHub Copilot:代码自动生成,从此告别手敲!

可以通过自定义提示词来引导Copilot生成符合自己需求的代码。再看一个做统计分析的。

Codewar的博客 349

从 Apache HTTP Server 到 CivetWeb:在鸿蒙 PC 的 3.1 MiB HAP 里嵌入 Web 服务器

当 Apache 遇上鸿蒙 PC:在一条不能 execv 的路上,把 Web 服务器装进 3.1MB 的进程里

qq_2778465975的博客 1万+

109. SAP ABAP 应用程序中的锁机制和工作原理介绍

SAP ABAP 系统中的锁概念,是 SAP ABAP 为了保证`数据一致性`而引入的一种保护机制。 像 SAP 这种复杂的企业级应用,系统中同一时间段的同一份数据,可能会有多个 Transaction(终端用户或者 API )同时进行读写操作。为了防止出现数据不一致,SAP ABAP 引入了锁机制。 这种锁机制并非数据库服务器层面的锁,而是在 SAP ABAP 应用服务器层面上工作,加锁和解锁都由专门的 ABAP Function Module 来完成。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1480

无修复版的洞怎么活:Apache Axis 1.x(CVE-2026-90436)与 EOL 组件的末日处置

CVE-2026-90436为Apache Axis 1.x严重RCE漏洞,CVSS 9.8,影响全版本且官方不再修复。攻击者可利用SOAP Fault的不安全类加载实现未认证远程代码执行,绕过认证与暴露面判断。该漏洞嵌入于Confluence、N-central等商业产品中,排查需从classpath考古入手,依赖厂商补丁而非Apache。无补丁时应立即网络隔离,结合日志、外联与文件变更排查利用痕迹,按宿主情况采取迁移、隔离或风险接受策略。本系列收官强调:暴露面管理优先于补丁,无补丁时代亦有标准处置路径—

彭大帅的博客 392

PyCharm 配置 Anaconda 环境时找不到 python.exe 的解决办法

通过本文的排查步骤与详细解决方案,你应该能够迅速定位并修复 PyCharm 配置 Anaconda 环境时找不到 python.exe 的问题。确保正确设置环境路径、激活目标环境以及手动指定解释器路径是解决此问题的关键。随着开发工具与包管理器的不断更新,类似的问题可能会出现新的变体。持续关注官方文档、社区讨论和版本更新,可以帮助开发者及时适应新变化,并优化工作流程。希望本文提供的分析和代码示例能为你的开发环境配置带来帮助,让你在 PyCharm 与 Anaconda 的高效协同下,专注于创新与代码实现。

s13596191285的博客 3125

一文看懂EMMC原理及工作过程

CMD:用于设备初始化和命令传输的双向通道, CMD信号有2种工作模式:1#:漏极开路--->用于初始化模式2#:推拉--->用于快速命令传输其中命令从eMMC主机控制器发送到eMMC设备,响应从设备发送到主机。DAT [7:0]:双向数据信号,模式包括:1(DAT0);默认情况下,通电或重置后,只有DAT0用于数据传输。DAT信号在推挽模式下工作,eMMC设备包括数据线DAT1-DAT7的内部上拉。进入4位模式后,设备立即断开线路DAT1、DAT2和DAT3的内部上拉;

Airer_00的博客 2053

Apache Doris 如何查询 Lance 数据集?vector_search、Prefilter 与延迟物化优化实战

Apache Doris 可以在支持 Lance 集成的版本中直接查询 Lance 数据集,并通过 `vector_search()` 复用兼容的向量索引,将相似度检索、业务过滤、SQL JOIN 和聚合分析组合到同一条查询链路中。

SelectDB 216

C#量化交易的市场数据采集与分析:从0到1构建你的‘数据雷达’——对比5大神器,代码实战全解析!

数据是量化交易的‘氧气’,而好的数据采集与分析是你的‘呼吸机’!本文5大神器+代码实战,总有一款适合你!(本文代码均经过测试,但请根据实际需求调整!

java专栏 737

Snowflake 有哪些开源替代方案?ClickHouse、DuckDB、Iceberg、Apache Doris 选型与迁移指南

Snowflake 有哪些开源替代方案?常见候选包括 Apache Doris、ClickHouse、DuckDB,以及 Apache Iceberg 搭配 Trino、Spark 等查询引擎的开放湖仓架构。

SelectDB 211

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

Apache SkyWalking 链路追踪描述

Apache SkyWalking是一款专为微服务、云原生环境设计的开源APM与分布式追踪系统。其核心架构由探针(Agent)、OAPServer、存储层和UI展示层构成,实现无侵入式数据采集与全链路追踪。通过字节码增强技术自动监控Java应用中的RPC、Web框架、数据库等调用,生成包含TraceID的调用链,并在拓扑图、追踪视图、仪表盘中可视化呈现服务依赖、性能指标与告警信息,助力快速定位瓶颈与故障根源。

. 387

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

食品日用小程序落地:商品温层实体建模与订单状态机验收

食品日用小程序先建商品实体:销售单位、箱规、温层与交付方式四字段定清楚,再把库存扣减、缺货替换与出票工位挂到同一条订单链。文中附字段表、状态流转与三类订单验收清单,并给出小艾普食品日用方案的多销售单位核对项。

weixin_51117207的博客 267

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

开源日志平台怎么选?ELK、Loki、ClickHouse、Apache Doris 四大方案对比与选型指南

开源日志平台没有统一的最优解。选型不仅要看每天写入多少日志,更要看日志如何查询、需要保留多久,以及能否在可接受的成本下满足检索和分析需求。

SelectDB 649

Docker 实战:安装 MySQL 8 与搭建 Apache Doris 集群

在本地或测试环境中,用 Docker 部署数据库是最省事的方式。本文记录两件事:一是用 Docker 安装 MySQL 8.0.44,二是用 Docker Compose 搭建 Apache Doris 3.1.3 的 FE + BE 单节点集群。文中同时给出国内网络环境下配置镜像加速源的完整方案,避免拉取镜像时卡在docker.io。操作系统:Linux(CentOS 7+ / Ubuntu 20.04+ 均可),本文命令以 Linux 为例。

2401_83857914的博客 225

把 Apache SkyWalking 搬上鸿蒙 PC:从 Java OAP 到原生 OAP-lite 的完整移植实践

把 Apache SkyWalking 搬上鸿蒙 PC:从 Java OAP 到原生 OAP-lite 的完整移植实践

qq_2778465975的博客 1万+

查询能力正面对比:国外时序数据库怎么查数据,Apache IoTDB 又是怎么查

本文对比了国外主流时序数据库(PromQL、InfluxDB、TimescaleDB、OpenTSDB)与Apache IoTDB的查询能力。PromQL专精监控但缺乏复杂分析;InfluxDB三代语言迭代混乱,Flux已进维护模式;TimescaleDB基于SQL但高级函数需额外扩展且部分功能实验性;OpenTSDB无原生查询语言。相比之下,Apache IoTDB统一采用标准SQL,表达力强、学习成本低、生态稳定,支持降采样、模式识别等复杂查询,长期维护性更优,是兼具灵活性与可持续性的优选方案。

不踩坑,不知道坑有多深;不总结,踩过的坑白踩。 2万+

Apache Doris Paimon Catalog 怎么配置?四种接入方式、S3 参数、外表性能与向量检索实战

Apache Doris 通过 Paimon Catalog 直接查询外部表,无需数据复制。支持四种元数据类型:filesystem(本地/对象存储)、hms(Hive Metastore)、dlf(阿里云DLF)和jdbc(实验性)。选型应优先复用现有稳定元数据体系。Warehouse路径需指向Paimon数据库目录上一级,避免配置错误导致元数据无法读取。接入后可用三段式名称查询,并通过@options、缓存等优化读取性能。向量检索测试显示外表耗时为内表的1.07~4.18倍,但非通用结论。

SelectDB 146

Spring Boot 集成 Apache Ignite:分布式缓存、SQL 和计算网格的落地笔记

本文介绍在高并发、分布式场景下,基于Ignite 2.16.x与Spring Boot 3.x(Java 17)的缓存与计算架构选型。对比Caffeine与Redis的局限性,阐述Ignite在分布式内存缓存、持久化存储、本地计算与亲和性分区上的优势。重点解析其核心机制:节点角色、持久化设计、分区副本、亲和性并置及集群发现策略,并提供Spring集成配置示例,强调合理设计亲和键与发现方式对性能的关键影响。

专注分享原创技术干货。大厂资深架构师,多年技术架构与技术管理经验,多年面试官经验。一对一技术指导培训,带你从小白到入门到架构设计到技术管理。关注我,免费领取学习资料。一对一免费面试指导,快速拿offer。 249

微信小程序云开发|云存储实现图片上传、下载与全屏预览

本文基于微信小程序云开发QuickStart模板,实现图片上传、云端存储、下载及大图预览全流程功能。通过wx.chooseMedia选择图片,wx.cloud.uploadFile上传至云存储,利用fileID下载文件并展示本地临时路径,结合wx.previewImage实现全屏预览。重点讲解云存储权限配置(建议设为“所有用户可读,仅创建者可读写”)、条件渲染、API使用及常见坑点(如权限错误、临时路径失效)。适合初学者学习云开发核心能力,提升小程序文件处理实战技能。

ANGEL9970的博客 233

说好 25 号开源,百度提前交卷:文心 5.5 Flash Preview 权重开放,280B 参数、1M 上下文、Apache 2.0

11 月 24 日,百度将文心 5.5 Flash Preview(ERNIE 5.5 Flash Preview)权重以 Apache 2.0 协议开源至 Hugging Face 与 ModelScope,比官方承诺的 11 月 25 日提前一天。模型为 MoE 架构:280B 总参数、14B 激活、1M 上下文、200+ token/s 解码。这是百度首次

liferecords的博客 275

Apache Solr 宣布正式拥抱 AI !

Apache Solr 10.1.0正式引入混合检索能力,实现关键词与向量搜索融合。通过knn近邻检索、language-models模块调用嵌入模型,支持“人话”查询;结合RRF算法合并两路结果,提升语义匹配精度。文档可索引时自动增强,兼顾精确与模糊查询需求,已具备生产可用性。

java1234的博客 346

开源鸿蒙PC适配教程:把 Apache NetBeans 29 完整搬到鸿蒙桌面端

原生 Presenter 线程读这个文件,解析头部,按 stride 逐行转成 RGBA,再按 ArkUI 表面的宽高比计算视口,保证画面不拉伸,最后锁 buffer 提交到 Surface。XComponent 收到的是 ArkUI 的指针、按键、滚轮事件,NetBeans 要的是 X11 事件,中间隔着两套模型:键码编号不同,滚轮方向不同,触控板给的是高频增量。会把目标 JDK、NetBeans、X11、Zero VM、JNA、profiler、兼容补丁、缓存和许可证一起打包成 HNP。

2202_76097976的博客 5641
上一篇: First Article
Plugcat
博客等级 码龄21年 1粉丝 1原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值