Spring Boot集成kudu快速入门Demo

1.什么是kudu

在Kudu出现前,由于传统存储系统的局限性,对于数据的快速输入和分析还没有一个完美的解决方案,要么以缓慢的数据输入为代价实现快速分析,要么以缓慢的分析为代价实现数据快速输入。随着快速输入和分析场景越来越多,传统存储层的局限性越来越明显,Kudu应运而生,它的定位介于HDFS和HBase之间,将低延迟随机访问,逐行插入、更新和快速分析扫描融合到一个存储层中,是一个既支持随机读写又支持OLAP分析的存储引擎

kudu应用场景

  • 适用于那些既有随机访问,也有批量数据扫描的复合场景
  • 高计算量的场景
  • 使用了高性能的存储设备,包括使用更多的内存
  • 支持数据更新,避免数据反复迁移
  • 支持跨地域的实时数据备份和查询

架构

2359044-20210815113801516-299445637
1、Table

表(Table)是数据库中用来存储数据的对象,是有结构的数据集合。kudu中的表具有schema和全局有序的primary key(主键)。kudu中一个table会被水平分成多个被称之为tablet的片段。

2、Tablet

一个 tablet 是一张 table连续的片段,tablet是kudu表的水平分区,类似于HBase的region。每个tablet存储着一定连续range的数据(key),且tablet两两间的range不会重叠。一张表的所有tablet包含了这张表的所有key空间 tablet 会冗余存储。放置到多个 tablet server上,并且在任何给定的时间点,其中一个副本被认为是leader tablet,其余的被认之为follower tablet。每个tablet都可以进行数据的读请求,但只有Leader tablet负责写数据请求

3、Tablet Server

tablet server负责数据存储,并提供数据读写服务 一个 tablet server 存储了table表的tablet,向kudu client 提供读取数据服务。对于给定的 tablet,一个tablet server 充当 leader,其他 tablet server 充当该 tablet 的 follower 副本 只有 leader服务写请求,然而 leader 或 followers 为每个服务提供读请求 。一个 tablet server 可以服务多个 tablets ,并且一个 tablet 可以被多个 tablet servers 服务着

4、Master Server

集群中负责集群管理、元数据管理等功能

2.环境安装

采用docker-composer安装

# 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.
version: "3"
services:kudu-master-1:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}ports:- "7051:7051"- "8051:8051"command: ["master"]volumes:- kudu-master-1:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251# TODO: Use `host.docker.internal` instead of KUDU_QUICKSTART_IP when it# works on Linux (https://github.com/docker/for-linux/issues/264)- >MASTER_ARGS=--fs_wal_dir=/var/lib/kudu/master--rpc_bind_addresses=0.0.0.0:7051--rpc_advertised_addresses=${KUDU_QUICKSTART_IP:?Please set KUDU_QUICKSTART_IP environment variable}:7051--webserver_port=8051--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8051--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-master-2:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}ports:- "7151:7151"- "8151:8151"command: ["master"]volumes:- kudu-master-2:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >MASTER_ARGS=--fs_wal_dir=/var/lib/kudu/master--rpc_bind_addresses=0.0.0.0:7151--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7151--webserver_port=8151--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8151--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-master-3:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}ports:- "7251:7251"- "8251:8251"command: ["master"]volumes:- kudu-master-3:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >MASTER_ARGS=--fs_wal_dir=/var/lib/kudu/master--rpc_bind_addresses=0.0.0.0:7251--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7251--webserver_port=8251--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8251--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-1:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7050:7050"- "8050:8050"command: ["tserver"]volumes:- kudu-tserver-1:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7050--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7050--webserver_port=8050--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8050--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-2:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7150:7150"- "8150:8150"command: ["tserver"]volumes:- kudu-tserver-2:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7150--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7150--webserver_port=8150--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8150--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-3:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7250:7250"- "8250:8250"command: ["tserver"]volumes:- kudu-tserver-3:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7250--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7250--webserver_port=8250--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8250--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-4:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7350:7350"- "8350:8350"command: ["tserver"]volumes:- kudu-tserver-4:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7350--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7350--webserver_port=8350--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8350--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=truekudu-tserver-5:image: apache/kudu:${KUDU_QUICKSTART_VERSION:-latest}depends_on:- kudu-master-1- kudu-master-2- kudu-master-3ports:- "7450:7450"- "8450:8450"command: ["tserver"]volumes:- kudu-tserver-5:/var/lib/kuduenvironment:- KUDU_MASTERS=kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251- >TSERVER_ARGS=--fs_wal_dir=/var/lib/kudu/tserver--rpc_bind_addresses=0.0.0.0:7450--rpc_advertised_addresses=${KUDU_QUICKSTART_IP}:7450--webserver_port=8450--webserver_advertised_addresses=${KUDU_QUICKSTART_IP}:8450--webserver_doc_root=/opt/kudu/www--stderrthreshold=0--use_hybrid_clock=false--unlock_unsafe_flags=true
volumes:kudu-master-1:kudu-master-2:kudu-master-3:kudu-tserver-1:kudu-tserver-2:kudu-tserver-3:kudu-tserver-4:kudu-tserver-5:

windows set env

$env:KUDU_QUICKSTART_VERSION = "1.12.0"
$env:KUDU_QUICKSTART_IP= "10.11.68.77"
Get-ChildItem Env:

linux set env

export KUDU_QUICKSTART_VERSION="1.12.0"
export KUDU_QUICKSTART_IP=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' | tail -1)

run

docker-compose -f docker/quickstart.yml up -d

stop

docker-compose -f docker/quickstart.yml down

    访问http://localhost:8051/

17211931983631

3.代码工程

 实验目的

实现java对kudu的创建表 ,插入,查询,修改操作

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>springboot-demo</artifactId><groupId>com.et</groupId><version>1.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><artifactId>kudu</artifactId><properties><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target><kudu-version>1.12.0</kudu-version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-autoconfigure</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.apache.kudu</groupId><artifactId>kudu-client</artifactId><version>${kudu-version}</version></dependency><!-- For logging messages. --><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-simple</artifactId><version>1.7.30</version></dependency><dependency><groupId>org.apache.kudu</groupId><artifactId>kudu-test-utils</artifactId><version>${kudu-version}</version><scope>test</scope></dependency></dependencies></project>

example.java

// 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.package com.et.kudu;import java.util.ArrayList;
import java.util.List;import org.apache.kudu.ColumnSchema;
import org.apache.kudu.Schema;
import org.apache.kudu.Type;
import org.apache.kudu.client.AlterTableOptions;
import org.apache.kudu.client.CreateTableOptions;
import org.apache.kudu.client.Insert;
import org.apache.kudu.client.KuduClient;
import org.apache.kudu.client.KuduException;
import org.apache.kudu.client.KuduPredicate;
import org.apache.kudu.client.KuduPredicate.ComparisonOp;
import org.apache.kudu.client.KuduScanner;
import org.apache.kudu.client.KuduSession;
import org.apache.kudu.client.KuduTable;
import org.apache.kudu.client.PartialRow;
import org.apache.kudu.client.RowResult;
import org.apache.kudu.client.RowResultIterator;
import org.apache.kudu.client.SessionConfiguration.FlushMode;/** A simple example of using the synchronous Kudu Java client to* - Create a table.* - Insert rows.* - Alter a table.* - Scan rows.* - Delete a table.*/
public class Example {private static final Double DEFAULT_DOUBLE = 12.345;private static final String KUDU_MASTERS = System.getProperty("kuduMasters", "localhost:7051");static void createExampleTable(KuduClient client, String tableName)  throws KuduException {// Set up a simple schema.List<ColumnSchema> columns = new ArrayList<>(2);columns.add(new ColumnSchema.ColumnSchemaBuilder("key", Type.INT32).key(true).build());columns.add(new ColumnSchema.ColumnSchemaBuilder("value", Type.STRING).nullable(true).build());Schema schema = new Schema(columns);// Set up the partition schema, which distributes rows to different tablets by hash.// Kudu also supports partitioning by key range. Hash and range partitioning can be combined.// For more information, see http://kudu.apache.org/docs/schema_design.html.CreateTableOptions cto = new CreateTableOptions();List<String> hashKeys = new ArrayList<>(1);hashKeys.add("key");int numBuckets = 8;cto.addHashPartitions(hashKeys, numBuckets);// Create the table.client.createTable(tableName, schema, cto);System.out.println("Created table " + tableName);}static void insertRows(KuduClient client, String tableName, int numRows) throws KuduException {// Open the newly-created table and create a KuduSession.KuduTable table = client.openTable(tableName);KuduSession session = client.newSession();session.setFlushMode(FlushMode.AUTO_FLUSH_BACKGROUND);for (int i = 0; i < numRows; i++) {Insert insert = table.newInsert();PartialRow row = insert.getRow();row.addInt("key", i);// Make even-keyed row have a null 'value'.if (i % 2 == 0) {row.setNull("value");} else {row.addString("value", "value " + i);}session.apply(insert);}// Call session.close() to end the session and ensure the rows are// flushed and errors are returned.// You can also call session.flush() to do the same without ending the session.// When flushing in AUTO_FLUSH_BACKGROUND mode (the mode recommended// for most workloads, you must check the pending errors as shown below, since// write operations are flushed to Kudu in background threads.session.close();if (session.countPendingErrors() != 0) {System.out.println("errors inserting rows");org.apache.kudu.client.RowErrorsAndOverflowStatus roStatus = session.getPendingErrors();org.apache.kudu.client.RowError[] errs = roStatus.getRowErrors();int numErrs = Math.min(errs.length, 5);System.out.println("there were errors inserting rows to Kudu");System.out.println("the first few errors follow:");for (int i = 0; i < numErrs; i++) {System.out.println(errs[i]);}if (roStatus.isOverflowed()) {System.out.println("error buffer overflowed: some errors were discarded");}throw new RuntimeException("error inserting rows to Kudu");}System.out.println("Inserted " + numRows + " rows");}static void scanTableAndCheckResults(KuduClient client, String tableName, int numRows) throws KuduException {KuduTable table = client.openTable(tableName);Schema schema = table.getSchema();// Scan with a predicate on the 'key' column, returning the 'value' and "added" columns.List<String> projectColumns = new ArrayList<>(2);projectColumns.add("key");projectColumns.add("value");projectColumns.add("added");int lowerBound = 0;KuduPredicate lowerPred = KuduPredicate.newComparisonPredicate(schema.getColumn("key"),ComparisonOp.GREATER_EQUAL,lowerBound);int upperBound = numRows / 2;KuduPredicate upperPred = KuduPredicate.newComparisonPredicate(schema.getColumn("key"),ComparisonOp.LESS,upperBound);KuduScanner scanner = client.newScannerBuilder(table).setProjectedColumnNames(projectColumns).addPredicate(lowerPred).addPredicate(upperPred).build();// Check the correct number of values and null values are returned, and// that the default value was set for the new column on each row.// Note: scanning a hash-partitioned table will not return results in primary key order.int resultCount = 0;int nullCount = 0;while (scanner.hasMoreRows()) {RowResultIterator results = scanner.nextRows();while (results.hasNext()) {RowResult result = results.next();if (result.isNull("value")) {nullCount++;}double added = result.getDouble("added");if (added != DEFAULT_DOUBLE) {throw new RuntimeException("expected added=" + DEFAULT_DOUBLE +" but got added= " + added);}resultCount++;}}int expectedResultCount = upperBound - lowerBound;if (resultCount != expectedResultCount) {throw new RuntimeException("scan error: expected " + expectedResultCount +" results but got " + resultCount + " results");}int expectedNullCount = expectedResultCount / 2 + (numRows % 2 == 0 ? 1 : 0);if (nullCount != expectedNullCount) {throw new RuntimeException("scan error: expected " + expectedNullCount +" rows with value=null but found " + nullCount);}System.out.println("Scanned some rows and checked the results");}public static void main(String[] args) {System.out.println("-----------------------------------------------");System.out.println("Will try to connect to Kudu master(s) at " + KUDU_MASTERS);System.out.println("Run with -DkuduMasters=master-0:port,master-1:port,... to override.");System.out.println("-----------------------------------------------");String tableName = "java_example-" + System.currentTimeMillis();KuduClient client = new KuduClient.KuduClientBuilder(KUDU_MASTERS).build();try {createExampleTable(client, tableName);int numRows = 150;insertRows(client, tableName, numRows);// Alter the table, adding a column with a default value.// Note: after altering the table, the table needs to be re-opened.AlterTableOptions ato = new AlterTableOptions();ato.addColumn("added", org.apache.kudu.Type.DOUBLE, DEFAULT_DOUBLE);client.alterTable(tableName, ato);System.out.println("Altered the table");scanTableAndCheckResults(client, tableName, numRows);} catch (Exception e) {e.printStackTrace();} finally {try {client.deleteTable(tableName);System.out.println("Deleted the table");} catch (Exception e) {e.printStackTrace();} finally {try {client.shutdown();} catch (Exception e) {e.printStackTrace();}}}}
}

以上只是一些关键代码,所有代码请参见下面代码仓库

代码仓库

  • GitHub - Harries/springboot-demo: a simple springboot demo with some components for example: redis,solr,rockmq and so on.

4.测试

 测试创建表

@Test
public void testCreateExampleTable() throws KuduException {String tableName = "test_create_example";Example.createExampleTable(client, tableName);assertTrue(client.tableExists(tableName));
}

插入数据

@Test
public void testInsertRows() throws KuduException {String tableName = "test_create_example";// Example.insertRows(client,tableName,100);System.out.println(client.getTableStatistics(tableName).getLiveRowCount());
}

7211937492543

dashboard可以看到我们创建的表和记录条数

5.引用

  • Apache Kudu - Fast Analytics on Fast Data
  • Spring Boot集成kudu快速入门Demo | Harries Blog™

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/47496.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

十五、【机器学习】【监督学习】- 神经网络回归

系列文章目录 第一章 【机器学习】初识机器学习 第二章 【机器学习】【监督学习】- 逻辑回归算法 (Logistic Regression) 第三章 【机器学习】【监督学习】- 支持向量机 (SVM) 第四章【机器学习】【监督学习】- K-近邻算法 (K-NN) 第五章【机器学习】【监督学习】- 决策树…

Django Q()函数

Q() 函数的作用 在Django中&#xff0c;Q()函数是一个非常有用的工具&#xff0c;主要用于构建复杂的查询。它允许你创建复杂的查询语句&#xff0c;包括AND、OR和NOT逻辑操作。这对于处理复杂的数据库查询特别有用&#xff0c;特别是在你需要组合多个条件或处理复杂的过滤逻辑…

HLS加密技术:保障流媒体内容安全的利器

随着网络视频内容的爆炸性增长&#xff0c;如何有效保护视频内容的版权和安全成为了一个亟待解决的问题。HLS&#xff08;HTTP Live Streaming&#xff09;加密技术作为一种先进的流媒体加密手段&#xff0c;凭借其高效性和安全性&#xff0c;在直播、点播等场景中得到了广泛应…

【C语言】联合体(union)

文章目录 1.联合体的含义2. 联合体的声明3. 联合体大小的计算4. 联合体的特点 1.联合体的含义 联合体也叫做共用体&#xff0c;是指联合体的所有成员共用同一块内存空间。这也就说明了&#xff0c;联合体的大小至少是其成员所占空间的最大值。 2. 联合体的声明 #include<…

【整体介绍】HTML和JS编写多用户VR应用程序的框架

一、Networked-Aframe是什么&#xff1f; 简称NAF&#xff0c;底层基于Mozilla的AFrame框架&#xff0c;用HTML和JS编写多用户VR应用程序的框架。 二、特性 支持 WebRTC 和/或 WebSocket 连接。 语音聊天。音频流让您的用户在应用程序内交谈&#xff08;仅限 WebRTC&#xff…

2024全球和国内最常用的弱密码,有没有你的?

密码管理器NordPass分析了来自公开来源的超过4.3TB 的密码数据&#xff0c;找出了当前为止&#xff08;2024年&#xff09;最常用&#xff08;最脆弱&#xff09;的密码。 这些密码主要有下面这些特征&#xff1a; 简单且常用&#xff0c;万年弱密码&#xff0c;比如123456、a…

智慧消防建设方案(完整方案参考PPT)

智慧消防系统建设方案旨在通过物联网、大数据与云计算技术&#xff0c;集成火灾自动报警、智能监控、应急指挥等功能于一体。方案部署智能传感器监测火情&#xff0c;实时数据分析预警&#xff0c;实现火灾早发现、早处置。构建可视化指挥平台&#xff0c;优化应急预案&#xf…

Python中发送邮件的艺术:普通邮件、PDF附件与Markdown附件

用的是qq邮箱,具体获取smtp的password可以看这个文章 获取密码 Python中发送邮件的艺术:普通邮件、PDF附件与Markdown附件 在今天的博客中,我们将探讨如何使用Python的smtplib库来发送电子邮件,包括发送普通文本邮件、携带PDF文件的邮件和附带Markdown文件的邮件。这些功能…

视频号助手获取feedId

1.登陆视频号 2.内容管理-视频 3.视频后分享

Git 用法

基本介绍 版本控制工具用处&#xff1a; 备份代码还原协同开发追溯 版本控制工具 1、集中式版本控制工具 版本库是集中存放在中央服务器的&#xff0c;team 里每个人 work 时从中央服务器下载代码&#xff0c;是必须联网才能工作&#xff0c;局域网或互联网。个人修改后然后…

【BUG】已解决:WslRegisterDistribution failed with error: 0x800701bc

已解决&#xff1a;WslRegisterDistribution failed with error: 0x800701bc 欢迎来到英杰社区https://bbs.csdn.net/topics/617804998 欢迎来到我的主页&#xff0c;我是博主英杰&#xff0c;211科班出身&#xff0c;就职于医疗科技公司&#xff0c;热衷分享知识&#xff0c;武…

【北京迅为】《i.MX8MM嵌入式Linux开发指南》-第二篇 Linux系统编程篇-第三十一章 文件IO和标准IO

i.MX8MM处理器采用了先进的14LPCFinFET工艺&#xff0c;提供更快的速度和更高的电源效率;四核Cortex-A53&#xff0c;单核Cortex-M4&#xff0c;多达五个内核 &#xff0c;主频高达1.8GHz&#xff0c;2G DDR4内存、8G EMMC存储。千兆工业级以太网、MIPI-DSI、USB HOST、WIFI/BT…

MySQL_基础知识

目录 一、数据库 二、数据库操作 2.1 显示当前数据库 2.2 创建数据库 2.3 删除数据库 2.4 使用数据库 三、数据类型 3.1 数值类型 3.2 字符串类型 3.3 日期类型 四、表的操作 4.1 创建表 4.2 显示当前库中的表 4.3 查看表结构 4.4 删除表 总结 一、数据库 数据…

AV1技术学习: Compound Prediction

一、双向 Compound Prediction AV1支持两个参考帧的预测通过多种复合模式线性组合。复合预测公式为 其中&#xff0c;权重m(x, y) is scaled by 64 以进行整数计算&#xff0c;R1(x, y)和R2(x, y)表示两个参考块中位于(x, y)的像素。P(x, y)将按比例缩小 1/64 以形成最终的预测…

【PPT笔记】1-3节 | 默认设置/快捷键/合并形状

文章目录 说明笔记1 默认设置1.1 OFFICE版本选择1.1.1 Office某某数字专属系列1.1.2 Office3651.1.3 产品信息怎么看 1.2 默认设置1.2.1 暗夜模式1.2.2 无限撤回1.2.3 自动保存&#xff08;Office2013版本及以上&#xff09;1.2.4 图片压缩1.2.5 字体嵌入1.2.6 多格式导出1.2.7…

代码随想录算法训练营Day26 | 491.递增子序列 | 46.全排列 | 47.全排列 II | 332.重新安排行程 | 51.N皇后 | 37.解数独

今日任务 491.递增子序列 题目链接&#xff1a; https://leetcode.cn/problems/non-decreasing-subsequences/description/题目描述&#xff1a; Code class Solution { public:vector<vector<int>> findSubsequences(vector<int>& nums) {vector&l…

关于Linux的面试题(实时更新中~)

一、软连接和硬连接的区别&#xff1a; 软连接创建方式 ln -s 被链接文件 链接文件 &#xff08;1&#xff09;软链接是一个链接文件&#xff1b; &#xff08;2&#xff09;软链接有着自己的 inode 号&#xff08;文件编号&#xff09;&#xff1b; &#xff08;3&#…

Linux入门攻坚——28、php、mysql基础

httpdphp&#xff1a;是在httpd中启用模块&#xff0c;不同的工作模式&#xff0c;使用的模块不同 modules httpd&#xff1a;prefork --> libphp5.so httpd&#xff1a;event or worker --> libphp5-zts.so php&#xff1a;引入zend engine后&#xff0c;分为…

复现GMM文章(五):图5代码和数据

介绍 复现GMM文章的的Fig5图。 加载R包 library(tidyr) library(tidyverse) library(dplyr) library(ggsci) library(ggpubr) library(psych) library(ggcorrplot) library(showtext) library(ggrepel)导入数据 所有的数据可以通过下列链接下载&#xff1a; 百度网盘链接…

Unity | Shader基础知识(第十八集:Stencil应用-透视立方盒子)

目录 一、前言 二、场景布置 三、 shader部分 1.图片的部分 2.图片部分纯净代码 3.遮罩部分复习 4.深度写入 ZWrite 5.颜色遮罩ColorMask 6.遮罩纯净代码 四、场景中shader使用 五、作者的碎碎念 一、前言 因为这个内容稍微有点多&#xff0c;我尽力讲清楚了&#x…