Greenplum 表空间和filespace的用法
转载:https://yq.aliyun.com/articles/190
Greenplum支持表空间,创建表空间时,需要指定filespace。
postgres=# \h create tablespace;
Command: CREATE TABLESPACE
Description: define a new tablespace
Syntax:
CREATE TABLESPACE tablespace_name [OWNER username] FILESPACE filespace_name
那么什么是filespace呢?
GP在初始化完后,有一个默认的filespace : pg_system。
表空间pg_default和pg_global都放在这个filespace下面。
也就是说一个filespace可以被多个表空间使用。
postgres=# select oid,* from pg_filespace;
oid | fsname | fsowner
------+-----------+---------
3052 | pg_system | 10
(1 row)
postgres=# select * from pg_tablespace;
spcname | spcowner | spclocation | spcacl | spcprilocations | spcmirlocations | spcfsoid
------------+----------+-------------+--------+-----------------+-----------------+----------
pg_default | 10 | | | | | 3052
pg_global | 10 | | | | | 3052
(2 rows)
还有TEMPORARY_FILES和TRANSACTION_FILES对应的filespace如下:
$gpfilespace --showtempfilespace
20151218:16:02:07:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-
A tablespace requires a file system location to store its database
files. A filespace is a collection of file system locations for all components
in a Greenplum system (primary segment, mirror segment and master instances).
Once a filespace is created, it can be used by one or more tablespaces.
20151218:16:02:07:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-Getting filespace information for TEMPORARY_FILES
20151218:16:02:08:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-Checking for filespace consistency
20151218:16:02:08:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining current filespace entries used by TEMPORARY_FILES
20151218:16:02:09:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-TEMPORARY_FILES OIDs are consistent for pg_system filespace
20151218:16:02:11:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-TEMPORARY_FILES entries are consistent for pg_system filespace
20151218:16:02:11:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining current filespace entries used by TEMPORARY_FILES
20151218:16:02:11:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-Current Filespace for TEMPORARY_FILES is pg_system
20151218:16:02:11:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-1 /disk1/digoal/gpdata/gpseg-1
20151218:16:02:11:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-25 /disk1/digoal/gpdata_mirror/gpseg0
20151218:16:02:11:063949 gpfilespace:127.0.0.1:digoal-[INFO]:-2 /disk1/digoal/gpdata/gpseg0
......
$gpfilespace --showtransfilespace
20151218:16:09:41:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-
A tablespace requires a file system location to store its database
files. A filespace is a collection of file system locations for all components
in a Greenplum system (primary segment, mirror segment and master instances).
Once a filespace is created, it can be used by one or more tablespaces.
20151218:16:09:41:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-Getting filespace information for TRANSACTION_FILES
20151218:16:09:41:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-Checking for filespace consistency
20151218:16:09:41:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining current filespace entries used by TRANSACTION_FILES
20151218:16:09:42:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-TRANSACTION_FILES OIDs are consistent for pg_system filespace
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-TRANSACTION_FILES entries are consistent for pg_system filespace
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining current filespace entries used by TRANSACTION_FILES
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-Current Filespace for TRANSACTION_FILES is pg_system
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-1 /disk1/digoal/gpdata/gpseg-1
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-25 /disk1/digoal/gpdata_mirror/gpseg0
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-2 /disk1/digoal/gpdata/gpseg0
20151218:16:09:44:071104 gpfilespace:127.0.0.1:digoal-[INFO]:-26 /disk1/digoal/gpdata_mirror/gpseg1
......
如果我们的greenplum集群中,有SSD硬盘,又有SATA硬盘。怎样更好的利用这些空间呢?
方法1.
用flashcache或bcache,通过device mapper技术,将SSD和SATA绑定,做成块设备。
再通过 逻辑卷管理 或者 软RAID 或者 brtfs or zfs管理起来,做成大的文件系统。
(还有一种方法是用RHEL 7提供的LVM,可以将SSD作为二级缓存)
这种方法对GP来说,是混合动力,可以创建一个或多个文件系统(都具备混合动力)。
所以建议只需要一个pg_system filespace就够了(除非容量到了文件系统管理的极限,那样的话可以分成多个文件系统)。
用多个文件系统的情况下,就需要对每个文件系统,创建对应的目录,以及filespace。
方法2.
SSD和SATA分开,各自创建各自的文件系统。
对每个文件系统,创建对应的目录,以及filespace。
创建filespace非常简单,分几步。
如下:
1. 创建目录,需要在所有的角色对应的主机中创建。给予gp 操作系统管理用户对应的权限。
master
$ mkdir /ssd1/gpdata/master_p
$ chown gpadmin:gpadmin /ssd1/gpdata/master_p
master standby
$ mkdir /ssd1/gpdata/master_s
$ chown gpadmin:gpadmin /ssd1/gpdata/master_s
segment
$ mkdir /ssd1/gpdata_p
$ chown gpadmin:gpadmin /ssd1/gpdata_p
segment mirror
$ mkdir /ssd1/gpdata_s
$ chown gpadmin:gpadmin /ssd1/gpdata_s
2. 查看系统配置
postgres=# select dbid,content,role,preferred_role,hostname,port from gp_segment_configuration order by role,dbid;
dbid | content | role | preferred_role | hostname | port
------+---------+------+----------------+-------------------+-------
2 | 0 | m | p | digoal.sqa.zmf | 40000
3 | 1 | m | p | digoal.sqa.zmf | 40001
4 | 2 | m | p | digoal.sqa.zmf | 40002
5 | 3 | m | p | digoal.sqa.zmf | 40003
6 | 4 | m | p | digoal.sqa.zmf | 40004
7 | 5 | m | p | digoal.sqa.zmf | 40005
8 | 6 | m | p | digoal.sqa.zmf | 40006
9 | 7 | m | p | digoal.sqa.zmf | 40007
10 | 8 | m | p | digoal.sqa.zmf | 40008
11 | 9 | m | p | digoal.sqa.zmf | 40009
12 | 10 | m | p | digoal.sqa.zmf | 40010
13 | 11 | m | p | digoal.sqa.zmf | 40011
14 | 12 | m | p | digoal.sqa.zmf | 40012
15 | 13 | m | p | digoal.sqa.zmf | 40013
16 | 14 | m | p | digoal.sqa.zmf | 40014
17 | 15 | m | p | digoal.sqa.zmf | 40015
18 | 16 | m | p | digoal.sqa.zmf | 40016
19 | 17 | m | p | digoal.sqa.zmf | 40017
20 | 18 | m | p | digoal.sqa.zmf | 40018
21 | 19 | m | p | digoal.sqa.zmf | 40019
22 | 20 | m | p | digoal.sqa.zmf | 40020
23 | 21 | m | p | digoal.sqa.zmf | 40021
24 | 22 | m | p | digoal.sqa.zmf | 50011
1 | -1 | p | p | digoal.sqa.zmf | 1921
25 | 0 | p | m | digoal.sqa.zmf | 41000
26 | 1 | p | m | digoal.sqa.zmf | 41001
27 | 2 | p | m | digoal.sqa.zmf | 41002
28 | 3 | p | m | digoal.sqa.zmf | 41003
29 | 4 | p | m | digoal.sqa.zmf | 41004
30 | 5 | p | m | digoal.sqa.zmf | 41005
31 | 6 | p | m | digoal.sqa.zmf | 41006
32 | 7 | p | m | digoal.sqa.zmf | 41007
33 | 8 | p | m | digoal.sqa.zmf | 41008
34 | 9 | p | m | digoal.sqa.zmf | 41009
35 | 10 | p | m | digoal.sqa.zmf | 41010
36 | 11 | p | m | digoal.sqa.zmf | 41011
37 | 12 | p | m | digoal.sqa.zmf | 41012
38 | 13 | p | m | digoal.sqa.zmf | 41013
39 | 14 | p | m | digoal.sqa.zmf | 41014
40 | 15 | p | m | digoal.sqa.zmf | 41015
41 | 16 | p | m | digoal.sqa.zmf | 41016
42 | 17 | p | m | digoal.sqa.zmf | 41017
43 | 18 | p | m | digoal.sqa.zmf | 41018
44 | 19 | p | m | digoal.sqa.zmf | 41019
45 | 20 | p | m | digoal.sqa.zmf | 41020
46 | 21 | p | m | digoal.sqa.zmf | 41021
47 | 22 | p | m | digoal.sqa.zmf | 41022
(47 rows)
3. 创建配置文件,格式如下,假如我要创建一个名为ssd1的filespace。
字段包含(hostname, dbid, DIR/$prefix + $content)
$ vi conf
filespace:ssd1
digoal.sqa.zmf:1:/ssd1/gpdata/master_p/gp-1
digoal.sqa.zmf:2:/ssd1/gpdata_p/gp0
digoal.sqa.zmf:3:/ssd1/gpdata_p/gp1
......
digoal.sqa.zmf:25:/ssd1/gpdata_s/gp0
digoal.sqa.zmf:26:/ssd1/gpdata_s/gp1
......
还有一种方法是使用gpfilespace -o conf来生成配置文件。(在提示时输入目录名DIR的部分即可)
4. 创建filespace
gpfilespace -c conf -h 127.0.0.1 -p 1921 -U digoal -W digoal
20151218:17:16:39:108364 gpfilespace:127.0.0.1:digoal-[INFO]:-Connecting to database
20151218:17:16:39:108364 gpfilespace:127.0.0.1:digoal-[INFO]:-Filespace "ssd1" successfully created
......
然后gpfilespace会自动在数据库执行以下DDL SQL。创建对应的filespace。
所以我们也可以自己在数据库中执行SQL来创建filespace。
CREATE FILESPACE ssd1
(
1: '/disk1/digoal/new_p/gp-1',
2: '/disk1/digoal/new_p/gp0',
3: '/disk1/digoal/new_p/gp1',
4: '/disk1/digoal/new_p/gp2',
5: '/disk1/digoal/new_p/gp3',
6: '/disk1/digoal/new_p/gp4',
7: '/disk1/digoal/new_p/gp5',
8: '/disk1/digoal/new_p/gp6',
9: '/disk1/digoal/new_p/gp7',
10: '/disk1/digoal/new_p/gp8',
11: '/disk1/digoal/new_p/gp9',
12: '/disk1/digoal/new_p/gp10',
13: '/disk1/digoal/new_p/gp11',
14: '/disk1/digoal/new_p/gp12',
15: '/disk1/digoal/new_p/gp13',
16: '/disk1/digoal/new_p/gp14',
17: '/disk1/digoal/new_p/gp15',
18: '/disk1/digoal/new_p/gp16',
19: '/disk1/digoal/new_p/gp17',
20: '/disk1/digoal/new_p/gp18',
21: '/disk1/digoal/new_p/gp19',
22: '/disk1/digoal/new_p/gp20',
23: '/disk1/digoal/new_p/gp21',
24: '/disk1/digoal/new_p/gp22',
25: '/disk1/digoal/new_s/gp0',
26: '/disk1/digoal/new_s/gp1',
27: '/disk1/digoal/new_s/gp2',
28: '/disk1/digoal/new_s/gp3',
29: '/disk1/digoal/new_s/gp4',
30: '/disk1/digoal/new_s/gp5',
31: '/disk1/digoal/new_s/gp6',
32: '/disk1/digoal/new_s/gp7',
33: '/disk1/digoal/new_s/gp8',
34: '/disk1/digoal/new_s/gp9',
35: '/disk1/digoal/new_s/gp10',
36: '/disk1/digoal/new_s/gp11',
37: '/disk1/digoal/new_s/gp12',
38: '/disk1/digoal/new_s/gp13',
39: '/disk1/digoal/new_s/gp14',
40: '/disk1/digoal/new_s/gp15',
41: '/disk1/digoal/new_s/gp16',
42: '/disk1/digoal/new_s/gp17',
43: '/disk1/digoal/new_s/gp18',
44: '/disk1/digoal/new_s/gp19',
45: '/disk1/digoal/new_s/gp20',
46: '/disk1/digoal/new_s/gp21',
47: '/disk1/digoal/new_s/gp22'
);
现在你可以使用这个filespace了.
例如
1. 将temp , trans移动到这个新的filespace.
$gpfilespace --movetempfilespace ssd1
20151218:17:17:29:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-
A tablespace requires a file system location to store its database
files. A filespace is a collection of file system locations for all components
in a Greenplum system (primary segment, mirror segment and master instances).
Once a filespace is created, it can be used by one or more tablespaces.
20151218:17:17:29:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Database was started in NORMAL mode
20151218:17:17:29:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Stopping Greenplum Database
20151218:17:17:57:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Starting Greenplum Database in master only mode
20151218:17:18:02:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Checking if filespace ssd1 exists
20151218:17:18:02:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Checking if filespace is same as current filespace
20151218:17:18:02:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Stopping Greenplum Database in master only mode
20151218:17:18:04:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Checking for connectivity
20151218:17:18:04:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining current filespace information
20151218:17:18:04:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining current filespace entries used by TEMPORARY_FILES
20151218:17:18:04:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Obtaining segment information ...
20151218:17:18:04:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Creating RemoteOperations list
20151218:17:18:04:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Moving TEMPORARY_FILES filespace from pg_system to ssd1 ...
20151218:17:18:06:008363 gpfilespace:127.0.0.1:digoal-[INFO]:-Starting Greenplum Database
$gpfilespace --movetransfilespace ssd1
...
20151218:17:19:17:055389 gpfilespace:127.0.0.1:digoal-[INFO]:-Moving TRANSACTION_FILES filespace from pg_system to ssd1 ...
20151218:17:21:16:055389 gpfilespace:127.0.0.1:digoal-[INFO]:-Starting Greenplum Database
2. 创建表空间,使用这个filespace.
postgres=# create tablespace tbs_ssd1 filespace ssd1;
CREATE TABLESPACE
postgres=# create table tt(id int) tablespace tbs_ssd1;
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
postgres=# select * from pg_tablespace ;
spcname | spcowner | spclocation | spcacl | spcprilocations | spcmirlocations | spcfsoid
------------+----------+-------------+--------+-----------------+-----------------+----------
pg_default | 10 | | | | | 3052
pg_global | 10 | | | | | 3052
tbs_ssd1 | 10 | | | | | 69681
(3 rows)
postgres=# select * from pg_filespace;
fsname | fsowner
-----------+---------
pg_system | 10
ssd1 | 10
(2 rows)
greenplum为什么会引入filespace的概念?
因为主机目录结构可能不一样,所以原有的目录结构式的方法来创建表空间,可能不够灵活。
最后,如何查看每个节点的filespace和location的关系?
digoal=# select a.dbid,a.content,a.role,a.port,a.hostname,b.fsname,c.fselocation from gp_segment_configuration a,pg_filespace b,pg_filespace_entry c where a.dbid=c.fsedbid and b.oid=c.fsefsoid order by content;
dbid | content | role | port | hostname | fsname | fselocation
------+---------+------+-------+-------------------+-----------+--------------------------------------
1 | -1 | p | 1921 | digoal193096.zmf | pg_system | /data01/gpdata/master_pgdata/gpseg-1
2 | 0 | p | 40000 | digoal193096.zmf | pg_system | /data01/gpdata/gpseg0
3 | 1 | p | 40001 | digoal193096.zmf | pg_system | /data01/gpdata/gpseg1
4 | 2 | p | 40002 | digoal193096.zmf | pg_system | /data01/gpdata/gpseg2
5 | 3 | p | 40000 | digoal199092.zmf | pg_system | /data01/gpdata/gpseg3
6 | 4 | p | 40001 | digoal199092.zmf | pg_system | /data01/gpdata/gpseg4
7 | 5 | p | 40002 | digoal199092.zmf | pg_system | /data01/gpdata/gpseg5
8 | 6 | p | 40000 | digoal200164.zmf | pg_system | /data01/gpdata/gpseg6
9 | 7 | p | 40001 | digoal200164.zmf | pg_system | /data01/gpdata/gpseg7
10 | 8 | p | 40002 | digoal200164.zmf | pg_system | /data01/gpdata/gpseg8
11 | 9 | p | 40000 | digoal204016.zmf | pg_system | /data01/gpdata/gpseg9
12 | 10 | p | 40001 | digoal204016.zmf | pg_system | /data01/gpdata/gpseg10
13 | 11 | p | 40002 | digoal204016.zmf | pg_system | /data01/gpdata/gpseg11
14 | 12 | p | 40000 | digoal204063.zmf | pg_system | /data01/gpdata/gpseg12
15 | 13 | p | 40001 | digoal204063.zmf | pg_system | /data01/gpdata/gpseg13
16 | 14 | p | 40002 | digoal204063.zmf | pg_system | /data01/gpdata/gpseg14
17 | 15 | p | 40003 | digoal193096.zmf | pg_system | /data01/gpdata/gpseg15
18 | 16 | p | 40003 | digoal199092.zmf | pg_system | /data01/gpdata/gpseg16
19 | 17 | p | 40003 | digoal200164.zmf | pg_system | /data01/gpdata/gpseg17
20 | 18 | p | 40003 | digoal204016.zmf | pg_system | /data01/gpdata/gpseg18
21 | 19 | p | 40003 | digoal204063.zmf | pg_system | /data01/gpdata/gpseg19
22 | 20 | p | 40000 | digoal209198.zmf | pg_system | /data01/gpdata/gpseg22
23 | 21 | p | 40001 | digoal209198.zmf | pg_system | /data01/gpdata/gpseg23
24 | 22 | p | 40002 | digoal209198.zmf | pg_system | /data01/gpdata/gpseg24
25 | 23 | p | 40003 | digoal209198.zmf | pg_system | /data01/gpdata/gpseg25
(25 rows)
[参考]
gpfilespace -h
Greenplum 表空间和filespace的用法的更多相关文章
- GreenPlum 数据库创建用户、文件空间、表空间、数据库
前几篇文章介绍了GreenPlum数据库的安装.启动.关闭.状态检查.登录等操作,数据库已经创建好了,接下来介绍如何使用数据库.按照习惯,需要先创建测试用户.表空间.数据库.先创建测试用户dbdrea ...
- oracle建库及plsql建表空间的用法
所有程序—>ORACLE-JHEMR----------->配置和移植工具----->DataBase Configuration Assistant-------中间就需要改一个数 ...
- oracle入坑日记<四>表空间
1 表空间是什么 1.1.数据表看做的货品,表空间就是存放货品的仓库.SQLserver 用户可以把表空间看做 SQLserver 中的数据库. 1.2.引用[日记二]的总结来解释表空间. 一个数 ...
- oracle 如何查看当前用户的表空间名称
如何查询当前用户的表空间名称?因为oracle建立索引,需要知道当前用户的表空间,查找了一下资料 --查询语法-- select default_tablespace from dba_users w ...
- 9. InnoDB通用表空间
9. InnoDB通用表空间 通用表空间是InnoDB 使用CREATE TABLESPACE语法创建的共享表空间.本节中的以下主题描述了常规表空间功能和功能: 通用表空间功能 创建通用表空间 将表添 ...
- 如何通过RMAN使用传输表空间迁移到不同的Endian平台 (Doc ID 371556.1)
How to Migrate to different Endian Platform Using Transportable Tablespaces With RMAN (Doc ID 371556 ...
- oracle之二表和表空间的关系
表和表空间的关系 建一个使用缺省值的表空间SQL> create tablespace a datafile '/u01/data/urpdb/a01.dbf' size 10m; 利用orac ...
- SYSTEM表空间满,解决方法
SYSTEM表空间是Oracle创建数据库时候自动创建的,每个Oracle数据库都会有SYSTEM表空间,而且SYSTEM表空间总是要保持在联机模式下,因为其包含了数据库运行所要求的基本信息,如:数据 ...
- Oracle 表空间和用户权限管理
一. 表空间 Oracle数据库包含逻辑结构和物理结构. 数据库的物理结构指的是构成数据库的一组操作系统文件. 数据库的逻辑结构是指描述数据组织方式的一组逻辑概念以及它们之间的关系. 表空间是数据库逻 ...
随机推荐
- 简单layer 快速上手
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- 【HC89S003F4开发板】 3串口调试
HC89S003F4开发板串口调试 使用资料自带的demo 主程序 /************************************系统初始化************************ ...
- 『Python基础』第5节:条件控制
if 语句的使用 单分支 if 条件: 满足条件后要执行的代码 例如: if 2 < 3: print(222) print(333) 每个条件后面都要使用冒号 :, 表示接下来是满足条件后要执 ...
- JAVA堆,栈的区别,用AarrayList、LinkedList自定义栈
大家都知道java模拟机在运行时要开辟空间所以它有特定的五个内存划分: 1.寄存器: 2.本地方法区: 3.方法区: 4.栈内存: 5.堆内存: 但是我们今天来注重讲一下栈和堆 ...
- [二叉树算法]关于判断是否为BST的算法
//判断是否为BST 搜索树==二叉排序树 1.递归知最大最小值.2.先中序判是否单调 bool IsValidBST(BTNode *p,int low,int high){ if(p==NULL) ...
- 用ASP.NET Web API技术开发HTTP接口(二)
在第一部分,我们创建了一个基本的ASP.NET Web API项目,新建成功了数据表,然后添加了一些测试数据,最后创建了API控制器,用json格式把数据表里面的内容成功输出到浏览器上.接下来我们将继 ...
- oracle 的分页、截断查询
oracle 分页.截断查询 需求:从车管所的备案库中(oracle)取出数据,放到车综大数据平台(http方式) 现场情况:oracle中有三张表,CZRKXX(常住人口信息),ZDRYXX(重点人 ...
- Java Web-JQuery学习
Java Web-JQuery学习 JQuery概念 是一个JS框架,可以用来简化JS的开发,设计宗旨是"write less,do more",即写更少的代码,做更多的事情.它封 ...
- react-native 沉浸式状态栏
使用StatusBar即可实现沉浸式,但是必须把背景色设置为透明.否则如果有不同页面的头部颜色不一样的话,导航栏的颜色动画会很怪异,不会是跟着页面一起动画. <StatusBar barStyl ...
- Java 之 字节输入流 [InputStream]
一.字节输入流 java.io.InputStream 抽象类是表示字节输入流的所有类的超类,可以读取字节信息到内存中. 它定义了字节输入流的基本共性功能方法. 共性方法: public void c ...